@sporeball/node-crush
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

node-crush

crush JavaScript files - reduce file size by 20% or more

a port of Aivo Paas' tool JSCrush for the modren era -- TypeScript declarations, no leaking to the global scope, etc.

uses a brute-force algorithm to produce a compressed statement that can be eval'ed back into the original.
this has been a staple of JS1k for many years.

disclaimer

aside from fixing scope issues, the algorithm used in this package is unchanged from the original, and may be prohibitively slow to produce output depending on the size of the input (several seconds or minutes).
as mentioned above, it also requires an eval for decompression; make sure you trust the code you're passing to it.

install

$ npm install @sporeball/node-crush

API

crush(input)

input

type: string

a string containing the JavaScript code to crush.


donate

you can support the development of this project and others via Patreon:

Support me on Patreon

Package Sidebar

Install

npm i @sporeball/node-crush

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

5.33 kB

Total Files

5

Last publish

Collaborators

  • sporeball