node-minecraft-data icon indicating copy to clipboard operation
node-minecraft-data copied to clipboard

publish compressed files ?

Open rom1504 opened this issue 2 years ago • 9 comments

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

rom1504 avatar Apr 09 '22 13:04 rom1504

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.

wgaylord avatar Nov 17 '23 18:11 wgaylord

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: @.***>

rom1504 avatar Nov 17 '23 23:11 rom1504

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

wgaylord avatar Nov 18 '23 00:11 wgaylord

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

jojomatik avatar Nov 20 '23 18:11 jojomatik

Ah right, forgot I had opened this

rom1504 avatar Nov 20 '23 19:11 rom1504

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

  • One big zip should be pretty good here

rom1504 avatar Apr 04 '24 19:04 rom1504

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.

extremeheat avatar Apr 05 '24 16:04 extremeheat

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 avatar Apr 05 '24 20:04 rom1504

tried there https://github.com/PrismarineJS/node-minecraft-data/pull/346

rom1504 avatar Apr 05 '24 22:04 rom1504