Registry / devops / minifyjs

minifyjs

JSON →
library0.2.0jsnpmunverified

A Node.js-based JavaScript minifier/beautifier providing an alternative to tools like UglifyJS, Closure Compiler, and YUI Compressor. Version 0.2.0 is the latest stable, released in 2011, with no active development. It supports minification and beautification of JavaScript code via a simple API or command-line interface. Key differentiator is its lightweight, single-dependency approach using 'uglify-js', but it lacks modern features and is largely superseded by ongoing projects.

npm install minifyjs
INSTALL
IMPORT
SIG · MINIFYJS
M
minifyjs
devopsjavascriptv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

minifyjs
import minifyjs from 'minifyjs'
const minifyjs = require('minifyjs')
Package does not provide ESM exports; CommonJS only. Use require or dynamic import.

Shows basic minification and beautification using the callback-based API.

const minifyjs = require('minifyjs'); const code = 'function hello() { return "world"; }'; minifyjs.minify(code, { level: 0 }, (err, minified) => { if (err) console.error(err); else console.log(minified); // 'function hello(){return"world"}' }); // Or beautify: const ugly = 'function hello( ){return"world"}'; minifyjs.beautify(ugly, {}, (err, beautified) => { console.log(beautified); // 'function hello() {\n return "world"\n}' }); // CLI: minifyjs input.js > output.min.js
Debug
Known issues
deprecatedPackage is unmaintained since 2011; consider using uglify-js or terser directly.
fix
Replace with uglify-js, terser, or esbuild for modern features and security updates.
affects: all
gotchaThe callback-based API requires the callback parameter; omitting it throws an error.
fix
Always provide a callback function.
affects: >=0.1.0
breakingMinify level defaults to 4 (maximum compression). Level 0 produces a shallow minification.
fix
Specify level explicitly if you want less aggressive minification.
affects: >=0.2.0
Errors
Common errors & fixes
Error: Callback is not a function
Missing callback parameter in minify() or beautify() call.
fix
minifyjs.minify(code, { level: 2 }, function(err, result) { ... })
Cannot find module 'uglify-js'
Missing dependency uglify-js. Package does not install it automatically.
fix
npm install uglify-js
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
uglify-jsrequiredCore dependency for JavaScript minification; older version may be pinned.
Agent activity
4 hits · last 30 days
node
4
Resources
minifyjs — npm install minifyjs · libregistry