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

[FEATURE]: expose support for brotli compression #390

Closed
JamieMagee opened this issue Jun 11, 2023 · 2 comments · Fixed by #391
Closed

[FEATURE]: expose support for brotli compression #390

JamieMagee opened this issue Jun 11, 2023 · 2 comments · Fixed by #391

Comments

@JamieMagee
Copy link
Contributor

minizlib has had support for brotli compression since 1.3.0, which was updated here in 0973296.

tar(1) has support for brotli compression currently via the -I/--use-compress-program option. For example:

tar -I brotli -cf archive.tar.br archive

But I've also proposed adding a top-level --brotli flag: https://lists.gnu.org/archive/html/bug-tar/2023-06/msg00002.html

@isaacs
Copy link
Owner

isaacs commented Jun 11, 2023

I like the idea.

In keeping with the pattern of mapping tar(1) options to node-tar options, I guess it'd be { I: 'brotli' } or { useCompressProgram: 'brotli' }? It's a bit weird to call it a "compress program" when it's all the same "program" though 🫤 Maybe those two could be aliases for compressAlgorithm or something?

@JamieMagee
Copy link
Contributor Author

tar(1) supports some algorithms (bzip2/xz/lzip/lzma/lzop/zstd) via -I/--use-compress-program that don't overlap with node-tar's support.

I think adding a brotli option or a compress option would be simpler. So you can provide options like:

const opts = {
  brotli: <true|brotli options> // same as gzip options
}

or

const opts = {
  compress: {
    algorithm: 'brotli', // or 'gzip'
    options: {
      level: 9
    }
  }
}

What do you think?

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 a pull request may close this issue.

2 participants