Detalhes do pacote

buffer-type

node-modules8.6kMIT1.0.0

Detect content-type from Buffer data.

buffer-type, image-type, content-type, buffer

readme (leia-me)

buffer-type

NPM version NPM quality build status Test coverage David deps Known Vulnerabilities NPM download

Detect content-type from Buffer data.

Install

$ npm install buffer-type

Usage

const bt = require('buffer-type');
const fs = require('fs');

const info = 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

changelog (log de mudanças)

1.0.0 / 2018-06-28

others

0.0.2 / 2014-05-04

  • add webp detect

0.0.1 / 2013-08-13

  • add bmp detect
  • add jpeg detect
  • add png image detect
  • add gif image detect
  • first commit