npm file-type 13.0.0

latest releases: 19.6.0, 19.5.0, 19.4.1...
4 years ago

Breaking

  • Require Node.js 10 0b97a85
  • Rewrite the API and make it async (#286) 8f981c3
    • Why: To be non-blocking, to be able to accept a stream as input, and improved file type detection.
    • Migrate:
-const fileType = require('file-type');
+const FileType = require('file-type');

-console.log(fileType(buffer));
+console.log(await FileType.fromBuffer(buffer));
  • Browser supports was moved into a sub-module:
    • Migrate:
-const fileType = require('file-type');
+const fileType = require('file-type/browser');

Enhancements

v12.4.2...v13.0.0

Don't miss a new file-type release

NewReleases is sending notifications on new releases.