Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Small and dependency free Nim package to infer file and MIME type checking the magic numbers signature.

License

NotificationsYou must be signed in to change notification settings

jiro4989/filetype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-actions

Small and dependency free Nim package to infer file and MIME type checking the magic numbers signature.filetype is heavily inspired byh2non/filetype.

import filetypelet content=readFile("tests/testdata/sample.png")doAssertmatch(content).extension=="png"doAssertmatchFile("tests/testdata/sample.png").mime.value=="image/png"doAssertisPngFile("tests/testdata/sample.png")ifisZipFile("tests/testdata/sample.zip"):echo"file is zip"
typeFileType*=object      mime*:Mime      extension*:string## File extension. (ex: `zip`)Mime*=object## MIME type.      typ*:string## Ex: `application` of `application/gzip`.      subType*:string## Ex: `gzip` of `application/gzip`.      value*:string## Ex: `application/gzip` of `application/gzip`.

Seefiletype module.

$ nimble install -Y filetype
TypeFormat
Imagejpeg, jp2, png, gif, webp, cr2, tiff, bmp, jxr, psd, ico, dwg
Archivegz, zip, bz2, 7z, pdf, exe, rtf, nes, crx, ps, xz, sqlite, deb, ar, lz, rpm, elf
Audiomidi, ogg, flac, wav, amr, mp3, aac
Fontwoff, woff2, ttf, otf
Videowmv, flv, avi, mpeg, mp4

MIT

About

Small and dependency free Nim package to infer file and MIME type checking the magic numbers signature.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp