puglify is a multithreaded wrapper around
uglify. It speeds up batch
minification of many small modules.
puglify stands for:
- parallel uglify
- the fact that a pug's face looks minified
const puglifier =// Optional. Number of threads to utilize. Defaults to `os.cpus().length`.threadCount: oslength;
Then, use either the Promise or Observable interfaces:
// Promise interface, single code stringpuglifier// If you're not running `puglify` frequently, feel free to// terminate the instance. Persisting it eliminates subsequent startup// times, which is useful for interactive applications.;// Promise interface, multiple code stringspuglifier// Observable interface, single code stringpuglifier// Promise interface, multiple code stringspuglifier
For each code string, the result type looks like:
// We return Buffers so we can pass code off easily to gzipcode: Buffererror: string
Multi-string results are just an object with names as keys and code/error objects as values.
puglify is wildly unstable! Use at your own risk until 1.0.0.
- Provide prebuilt binaries for all major platforms.
- Ensure crash safety in all V8 code.
- Audit for memory leaks.
- Setup CI.