1.1.0 • Published 3 months ago

compresso v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

compresso

Bundle too big? Way too much code to write? Don't stress! Take a compresso!

Compresso is a quick, zero-dependency utility library with micro-optimized utilities to reduce duplicated, long code while ensuring type security.

    pnpm i compresso

And then only import what you need as compresso is tree-shakable!

Motivation

Bundler can not optimize and minify everything. While the concept of name-mangling exists, it's not very well used in esbuild-based bundlers like vite when it comes to object properties. Built-Ins like Number, Math, Object, Array and more can't be minified at all. But with compresso, it can quickly turn code like Object.getOwnPropertyDescriptors that can't be minified into getPropDescriptor that be minified to just g().

Beware that the bundle can only be reduced by heavy use of those built-ins. This is most likely the case in very large projects. compresso always comes with an overhead of 100 - 200 bytes for just the built-in compressions.


@ 2025 Torathion