Socket
Socket
Sign inDemoInstall

buffer-type

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    buffer-type

Detect content-type from Buffer data.


Version published
Weekly downloads
1.5K
increased by20.49%
Maintainers
1
Install size
20.7 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 28 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc