Skip to content

node-modules/buffer-type

Repository files navigation

buffer-type

NPM versionNPM qualitybuild statusTest coverageDavid depsKnown VulnerabilitiesNPM download

Detect content-type from Buffer data.

Install

$ npm install buffer-type

Usage

constbt=require('buffer-type');constfs=require('fs');constinfo=bt(fs.readFileSync(__dirname+'/logo.png'));console.log(info);//{// type: 'image/png',// extension: '.png',// width: 618,// height: 96,// bit: 8, // bit depth// color: 6,// compression: 0,// filter: 0,// interlace: 0// }

References

TODO

  • Image
    • [√] .png
    • [√] .jpg
    • [√] .bmp
    • [√] .gif
    • [√] .webp
    • .svg
    • .tif
    • .psd
  • Tar
    • .tar
    • .gzip
    • .zip
    • .rar
  • PE file
    • .exe
    • .msi
    • .apk
    • .ipa
  • Text
    • .xml
    • .html
    • .json
  • Media
    • .mp3
    • .mp4
    • .avi

License

MIT

About

Detect content-type from Buffer data.

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •