Registry / devops / nijm
library1.4.1jsnpmunverified

A JavaScript minifier that prioritizes readability over aggressive compression, similar to Crockford's JSMin. Version 1.4.1 is the latest stable release with irregular updates. Supports ES2015 template strings by default and retains line feeds to ease debugging unless explicitly told to uglify. Differentiates from UglifyJS/Terser by minimal transformations, making output more human-readable at the cost of smaller size. Suitable for cases where you need basic whitespace removal without renaming variables or restructuring code.

npm install nijm
INSTALL
IMPORT
SIG · NIJM
N
nijm
devopsjavascriptv1.4.1
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.

nijm
var nijm = require('nijm');
import nijm from 'nijm';
nijm is CommonJS only; no ESM exports. Using import will fail.
nijm
const nijm = require('nijm');
let nijm = require('nijm');
Preferred modern CommonJS style.
nijm
import nijm from 'nijm'; // Only if using dynamic import
ESM dynamic import works but is not the primary API; static import fails.

Import nijm, minify a simple function, and compare default (readable) vs ugly mode.

const nijm = require('nijm'); const src = 'function hello( name ) { return "Hello, " + name; }'; const minSrc = nijm(src); console.log(minSrc); // Output: function hello(name){return "Hello, "+name;} const uglySrc = nijm(src, true); console.log(uglySrc); // Output: function hello(name){return "Hello, "+name;}
Debug
Known issues
gotchanijm only removes whitespace and comments; it does not rename variables or perform advanced optimizations.
fix
Use Terser or UglifyJS if you need variable renaming or dead code elimination.
affects: >=0.0.0
gotchaDefault mode preserves some line breaks; if you want maximum compression, pass true as second argument.
fix
Call nijm(src, true) to strip all unnecessary line breaks.
affects: >=0.0.0
Errors
Common errors & fixes
SyntaxError: Unexpected token 'export'
Attempting to use ESM import syntax (import ... from 'nijm') which is not supported.
fix
Use require('nijm') instead.
nijm is not a function
Incorrectly imported as a default export from an ESM context that doesn't interop.
fix
Use const nijm = require('nijm').default; or better, use CommonJS require.
Upgrade
Version history
1.4.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
53 hits · last 30 days
node
30
Bingbot
22
Resources
packagenijm
nijm — npm install nijm · libregistry