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

publish compressed files ? #185

Open
rom1504 opened this issue Apr 9, 2022 · 9 comments
Open

publish compressed files ? #185

rom1504 opened this issue Apr 9, 2022 · 9 comments

Comments

@rom1504
Copy link
Member

rom1504 commented Apr 9, 2022

it would reduce the size of nmd package on disk
decompression cost at run time would probably be minimal

@wgaylord
Copy link
Contributor

wgaylord commented Nov 17, 2023

minecraft-data now takes up over 145MB of space (149360KB) on disk when installed. A way to easily shrink this size without any extra code would be to minify the JSON data before publishing to npm. (Remove the extra new lines that make it human read-able.) This alone shrinks it down to around 115MB (116788KB) Using an actual compression on top of this would be an improvement as well.

@rom1504
Copy link
Member Author

rom1504 commented Nov 17, 2023 via email

@wgaylord
Copy link
Contributor

Thats what I assumed this issue was about, was just giving my input.

@jojomatik
Copy link

Thats what I assumed this issue was about, was just giving my input.

Yep, that was the original idea of the issue: PrismarineJS/node-minecraft-protocol#978 (comment)

@rom1504
Copy link
Member Author

rom1504 commented Nov 20, 2023

Ah right, forgot I had opened this

@rom1504
Copy link
Member Author

rom1504 commented Apr 4, 2024

https://www.npmjs.com/package/node-stream-zip

  • One big zip should be pretty good here

@extremeheat
Copy link
Member

Yeah, publishing a zip seems to be best. node-stream-zip doesn't support sync but it seems https://github.com/cthackers/adm-zip does.

If anyone wants to do it the API seems simple to use also.

@rom1504
Copy link
Member Author

rom1504 commented Apr 5, 2024

Another way would be to compress file independently. Kind of same as zip really

Would just need to try out when to run this, eg pre publish post install etc and see loading time and if that breaks web

@rom1504
Copy link
Member Author

rom1504 commented Apr 5, 2024

tried there #346

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

4 participants