file-type

Detect the file type of a Buffer/Uint8Array/ArrayBuffer

MIT License

Downloads
87.1M
Stars
3.5K
Committers
109

Bot releases are hidden (Show)

file-type -

Published by sindresorhus over 4 years ago

  • Add support for Encapsulated PostScript (EPS) (#353) 070c4c1

https://github.com/sindresorhus/file-type/compare/v14.2.0...v14.3.0

file-type -

Published by sindresorhus over 4 years ago

  • Add support for SKP (#351) 30e8354
  • Add support for AVIF (#344) 394a920

https://github.com/sindresorhus/file-type/compare/v14.1.4...v14.2.0

file-type -

Published by sindresorhus over 4 years ago

file-type -

Published by sindresorhus over 4 years ago

  • Fix bug for short streams where stream ends on first read (#334) 90a213d

https://github.com/sindresorhus/file-type/compare/v14.1.2...v14.1.3

file-type -

Published by sindresorhus over 4 years ago

  • Fix missing fromTokenizer type definition (#331) 3432a14

https://github.com/sindresorhus/file-type/compare/v14.1.1...v14.1.2

file-type -

Published by sindresorhus over 4 years ago

  • Prevent throwing error in .stream() on empty stream (#324) 659e379

https://github.com/sindresorhus/file-type/compare/v14.1.0...v14.1.1

file-type -

Published by sindresorhus over 4 years ago

  • Add support for MPEG program stream (#322) 383a831
  • Add support for AI files (Adobe Illustrator) (#323) 5eb8458

https://github.com/sindresorhus/file-type/compare/v14.0.0...v14.1.0

file-type -

Published by sindresorhus over 4 years ago

Breaking

Fixes

  • Fix detecting PNG with long iTXt chunk (#321) a59869b

https://github.com/sindresorhus/file-type/compare/v13.1.2...v14.0.0

file-type -

Published by sindresorhus over 4 years ago

  • Detect Office 365 documents: docx, pptx, xlsx (#317) 8f70d9c
  • Fix end-of-stream exception in PNG level 2 parser (#316) 79d9e25

https://github.com/sindresorhus/file-type/compare/v13.1.1...v13.1.2

file-type -

Published by sindresorhus over 4 years ago

  • Prevent size related exceptions (#307) 936b020
  • Ensure .fromBuffer() always returns a Promise (#310) 7eaf0fe

https://github.com/sindresorhus/file-type/compare/v13.1.0...v13.1.1

file-type -

Published by sindresorhus almost 5 years ago

  • Add audio module detections: .it, .s3m & .xm (#305) b824802

https://github.com/sindresorhus/file-type/compare/v13.0.3...v13.1.0

file-type -

Published by sindresorhus almost 5 years ago

file-type -

Published by sindresorhus almost 5 years ago

  • TypeScript type fixes e209647 2c86443 32b2948

https://github.com/sindresorhus/file-type/compare/v13.0.1...v13.0.2

file-type -

Published by sindresorhus almost 5 years ago

  • Fix TypeScript types for the browser sub-module fb15b12 2ed0d92

https://github.com/sindresorhus/file-type/compare/v13.0.0...v13.0.1

file-type -

Published by sindresorhus almost 5 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

  • Add .fromFile() method to detect the file type of a file (#286) 8f981c3
  • Add .fromStream() method to detect the file type of a stream (#286) 8f981c3
    If you have access to the file, this method is recommended over .fromBuffer(), as it can better optimize the detection speed.
  • Add .fromBlob() convenience method when used in the browser (#286) 8f981c3
  • Add support for CR3 (#292) 204599a
  • Stop execution after FileType.stream() error (#273) 3840e6a

https://github.com/sindresorhus/file-type/compare/v12.4.2...v13.0.0

file-type -

Published by sindresorhus almost 5 years ago

  • Fix .m4b MPEG-4 audio-book detection (#256) d879ef7

https://github.com/sindresorhus/file-type/compare/v12.4.1...v12.4.2

file-type -

Published by sindresorhus almost 5 years ago

  • Fix extensions and mimeTypes TypeScript types (#270) eff47af

https://github.com/sindresorhus/file-type/compare/v12.4.0...v12.4.1

file-type -

Published by sindresorhus almost 5 years ago

  • Add support for Apache Arrow (#253) 9767ad1
  • Add support for Esri Shapefile (#252) 54beff7

https://github.com/sindresorhus/file-type/compare/v12.3.1...v12.4.0

file-type -

Published by sindresorhus almost 5 years ago

  • Fix false-positive in ARW detection (#251) f379c5b

https://github.com/sindresorhus/file-type/compare/v12.3.0...v12.3.1

file-type -

Published by sindresorhus about 5 years ago

Package Rankings
Top 11.3% on Repo1.maven.org
Top 0.6% on Npmjs.org
Top 5.77% on Proxy.golang.org