If you're adding support for a new file type, please follow the below steps:
- One PR per file type.
- Add a fixture file named
fixture.<extension>
to thefixture
directory. - Add the file extension to the
extensions
array insupported.js
. - Add the file's MIME type to the
types
array insupported.js
. - Add the file type detection logic to the
core.js
file - Respect the sequence:
- Signature with shorter sample size (counted from offset 0 until the last required byte position) will be executed first.
- Only the initial determination for the file type counts for the sequence.
- Existing signatures requiring same sample length (same signature group) will be tested prior to your new detections. Yours will be last. (rational: common formats first).
- Add the file extension to the
FileType
type incore.d.ts
. - Add the file's MIME type to the
MimeType
type incore.d.ts
. - Add the file extension to the
Supported file types
section of the readme in alphabetical order, in the format- [`<extension>`](URL) - Format name
, for example,- [`png`](https://en.wikipedia.org/wiki/Portable_Network_Graphics) - Portable Network Graphics
- Add the file extension to the
keywords
array in thepackage.json
file. - Run
$ npm test
to ensure the tests pass. - Open a pull request with a title like
Add support for Format
, for example,Add support for PNG
. - The pull request description should include a link to the official page of the file format or some other source. Also include a link to where you found the file type detection / magic bytes and the MIME type.