Open rom1504 opened 2 years ago
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.
Files are already published compressed. Npm does that by default
Is your goal to decrease your local node modules space use ?
On Fri, Nov 17, 2023, 19:15 William Gaylord @.***> wrote:
minecraft-data now takes up over 145MB of space (149360KB) on disk when installed. A way to easily shrink this size without and extra code would be to minify the JSON data before publishing to nom. (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.
— Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/node-minecraft-data/issues/185#issuecomment-1816881368, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437TIL6LR6MUFZTGVWULYE6SSRAVCNFSM5S7ADWLKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRGY4DQMJTGY4A . You are receiving this because you authored the thread.Message ID: @.***>
Thats what I assumed this issue was about, was just giving my input.
Thats what I assumed this issue was about, was just giving my input.
Yep, that was the original idea of the issue: https://github.com/PrismarineJS/node-minecraft-protocol/issues/978#issuecomment-1094011178
Ah right, forgot I had opened this
https://www.npmjs.com/package/node-stream-zip
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.
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
it would reduce the size of nmd package on disk decompression cost at run time would probably be minimal