Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Zstandard compressed file #439

Merged
merged 2 commits into from
Mar 6, 2021
Merged

Conversation

ardavank
Copy link
Contributor

@ardavank ardavank commented Mar 5, 2021

https://en.wikipedia.org/wiki/Zstandard

Zstandard

Filename extension:
.zst

Internet media type:
application/zstd

Magic number :
28 b5 2f fd

Type of format Data compression:
Standard RFC 8478

Website:
https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md

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 the fixture directory.
  • Add the file extension to the extensions array in supported.js.
  • Add the file's MIME type to the types array in supported.js.
  • Add the file type detection logic to the core.js file.
  • Add the file extension to the FileType type in core.d.ts.
  • Add the file's MIME type to the MimeType type in core.d.ts.
  • Add the file extension to the Supported file types section in the readme, 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 the package.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.

https://en.wikipedia.org/wiki/Zstandard

**Zstandard**

Filename extension:
.zst

Internet media type:
application/zstd

Magic number	:
28 b5 2f fd

Type of format	Data compression:
Standard	RFC 8478

Website:
https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md
Copy link
Collaborator

@Borewit Borewit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@Borewit Borewit merged commit 9319167 into sindresorhus:main Mar 6, 2021
@ardavank
Copy link
Contributor Author

ardavank commented Mar 6, 2021

@Borewit @sindresorhus thanks for the review, can you please release a new version that includes this change?

@ardavank
Copy link
Contributor Author

ardavank commented Mar 6, 2021

Nvm, I just saw that you’ve already released 16.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants