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 almost 3 years ago

Breaking

  • Require Node.js 12.20 (#472) 826b4ad
  • This package is now pure ESM. Please read this.
  • Remove the /browser sub-export 287e361
    • Browser support is now included by default.
  • Moved from a default export to named exports:
    require('file-type').fromBufferimport {fileTypeFromBuffer} from 'file-type'
    require('file-type').fromFileimport {fileTypeFromFile} from 'file-type'
    require('file-type').fromStreamimport {fileTypeFromStream} from 'file-type'
    require('file-type').fromTokenizerimport {fileTypeFromTokenizer} from 'file-type'
    require('file-type').streamimport {fileTypeStream} from 'file-type'
    require('file-type').extensionsimport {supportedExtensions} from 'file-type'
    require('file-type').mimeTypesimport {supportedMimeTypes} from 'file-type'

Improvements

  • Improve WebM detection (#486) b23be62
  • Improve parsing TIFF files (#482) 82c9ccb
  • Detect both raw and BDAV versions of MPEG-2 Transport Streams (#497) 4ce6838
  • Detect XML UTF-16-BE & UTF-16-LE via pattern matching (#490) a2cf2b3
  • Support XML encoding with UTF-8 including BOM field (#491) 8bca6b4

Fixes

  • Prevent End-Of-Stream error in stream() (#468) 67c8fcb

https://github.com/sindresorhus/file-type/compare/v16.5.1...v17.0.0

file-type -

Published by sindresorhus about 3 years ago

file-type -

Published by sindresorhus about 3 years ago

  • Lock strtok3 dependency
file-type -

Published by sindresorhus over 3 years ago

  • Fix mimeTypes TypeScript type (#464) 0012c56

https://github.com/sindresorhus/file-type/compare/v16.5.0...v16.5.1

file-type -

Published by sindresorhus over 3 years ago

  • Add support for JPEG XL image format (#455) 57ecf2d
  • Remove ASAR 240 bytes of JSON payload length limitation (#453) 07101ac
  • Remove an unnecessary dependency (#458) 3df0ed1

https://github.com/sindresorhus/file-type/compare/v16.4.0...v16.5.0

file-type -

Published by sindresorhus over 3 years ago

  • Add support for VCF and fix ICS detection (#451) 29618c8
  • Add support for XCF (#450) 6ab25f3

https://github.com/sindresorhus/file-type/compare/v16.3.0...v16.4.0

file-type -

Published by sindresorhus over 3 years ago

  • Add support for Zstandard compressed file (#439) 9319167

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

file-type -

Published by sindresorhus almost 4 years ago

  • Improve PDF / AI (Adobe Illustrator) recognition (#396) 9736aa3
  • Add support for 3mf (#415) 7f95cd2

https://github.com/sindresorhus/file-type/compare/v16.1.0...v16.2.0

file-type -

Published by sindresorhus almost 4 years ago

file-type -

Published by sindresorhus almost 4 years ago

  • Fix Webpack 5 compatibility (#412) eab48da

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

file-type -

Published by sindresorhus about 4 years ago

Breaking

  • Replace .wma / .wmv with .asf detection (the container format) (#398) fe331be

Improvements

  • Add support for ASCII STL (#405) f227ac2

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

file-type -

Published by sindresorhus about 4 years ago

  • Prevent detecting corrupt PNG file (#392) ec88386

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

file-type -

Published by sindresorhus about 4 years ago

Breaking

  • Replace MSI detection with Microsoft CFB (#388) 5de41fd

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

file-type -

Published by sindresorhus about 4 years ago

file-type -

Published by sindresorhus about 4 years ago

  • Fix the .extensions TypeScript type (#380) a58081c
  • Add support for Asar (#378) f2ebb8d
  • Add support for InDesign document file type (#373) 84c26b3

https://github.com/sindresorhus/file-type/compare/v14.6.2...v14.7.0

file-type -

Published by sindresorhus over 4 years ago

  • Fix error when using FileType.fromStream() on small files (#370) 50eee35

https://github.com/sindresorhus/file-type/compare/v14.6.1...v14.6.2

file-type -

Published by sindresorhus over 4 years ago

  • Fix ZIP header detection for MS Office files (#369) 402fb0b

https://github.com/sindresorhus/file-type/compare/v14.6.0...v14.6.1

file-type -

Published by sindresorhus over 4 years ago

file-type -

Published by sindresorhus over 4 years ago

file-type -

Published by sindresorhus over 4 years ago

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