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

Substitutig node-zopfi-es with @gfx/zopfli #13

Closed
dilyanpalauzov opened this issue Apr 1, 2020 · 3 comments
Closed

Substitutig node-zopfi-es with @gfx/zopfli #13

dilyanpalauzov opened this issue Apr 1, 2020 · 3 comments

Comments

@dilyanpalauzov
Copy link
Contributor

Here is an example using zopfi but from @gfx/zopfli instead of node-zopfi-es. The advantage of the former is that it does not depend on node-gyp and the disadvantage of the latter is that it takes very, very long on every yarn update.

import { gzipAsync } from '@gfx/zopfli';

 gzipPlugin({
  customCompression: content => gzipAsync(Buffer.from(content), {numiterations: 15}),
  })
@kryops kryops closed this as completed in bc3ade0 Apr 5, 2020
@kryops
Copy link
Owner

kryops commented Apr 5, 2020

hi @dilyanpalauzov , thanks for all your suggestions, I tried to add them to the README 😊

@dilyanpalauzov
Copy link
Contributor Author

For @gfx/zopfli the readme does not clarify that gzipAsync() must be used. It took me a lot of time to figure this out myself.

kryops added a commit that referenced this issue Apr 10, 2020
@kryops
Copy link
Owner

kryops commented Apr 10, 2020

😳 of course you're right - my node-zopfli example was wrong already as their gzip function takes a callback as well. Only they provide a gzipSync alternative while @gfx/zopfli provides a gzipAsync alternative 🙄

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

No branches or pull requests

2 participants