JSPM

pull-identify-filetype

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q26538F
  • License MIT

Identify the type of file passing through the stream

Package Exports

  • pull-identify-filetype

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pull-identify-filetype) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pull-identify-filetype

Identifies the file-type passing through the stream using the magic-number signatures at the start of the file.

var pull = require('pull-stream')
var identify = require('pull-identify-filetype')

pull(
  /* source */
  identify(function (type) {
    console.log(type) // => string | false
  }),
  /* sink */
)

Supported types:

jpg png gif bmp tif tif nif ico psd rar zip gz tar msi iso rtf avi mov wmv wma swf flv mid pdf doc docx mp3 svg html

Tested:

tif pdf psd gif jpg png bmp tif ico rar docx gz tar doc rtf mov svg html