{"id":41598,"library":"nijm","title":"nijm","description":"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.","status":"active","version":"1.4.1","language":"javascript","source_language":"en","source_url":"git://github.com/manvalls/nijm","tags":["javascript"],"install":[{"cmd":"npm install nijm","lang":"bash","label":"npm"},{"cmd":"yarn add nijm","lang":"bash","label":"yarn"},{"cmd":"pnpm add nijm","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"nijm is CommonJS only; no ESM exports. Using import will fail.","wrong":"import nijm from 'nijm';","symbol":"nijm","correct":"var nijm = require('nijm');"},{"note":"Preferred modern CommonJS style.","wrong":"let nijm = require('nijm');","symbol":"nijm","correct":"const nijm = require('nijm');"},{"note":"ESM dynamic import works but is not the primary API; static import fails.","wrong":"","symbol":"nijm","correct":"import nijm from 'nijm'; // Only if using dynamic import"}],"quickstart":{"code":"const nijm = require('nijm');\nconst src = 'function hello( name ) { return \"Hello, \" + name; }';\nconst minSrc = nijm(src);\nconsole.log(minSrc);\n// Output: function hello(name){return \"Hello, \"+name;}\nconst uglySrc = nijm(src, true);\nconsole.log(uglySrc);\n// Output: function hello(name){return \"Hello, \"+name;}","lang":"javascript","description":"Import nijm, minify a simple function, and compare default (readable) vs ugly mode."},"warnings":[{"fix":"Use Terser or UglifyJS if you need variable renaming or dead code elimination.","message":"nijm only removes whitespace and comments; it does not rename variables or perform advanced optimizations.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Call nijm(src, true) to strip all unnecessary line breaks.","message":"Default mode preserves some line breaks; if you want maximum compression, pass true as second argument.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'1.4.1':17 'aggress':9 'basic':68 'case':64 'code':76 'compress':10 'cost':58 'crockford':13 'debug':38 'default':31 'differenti':44 'eas':37 'es2015':27 'explicit':40 'feed':35 'human':54 'human-read':53 'irregular':24 'javascript':3,77 'jsmin':15 'latest':20 'line':34 'make':50 'minifi':4 'minim':48 'need':67 'nijm':1 'output':51 'priorit':6 'readabl':7,55 'releas':22 'remov':70 'renam':72 'restructur':75 'retain':33 'similar':11 'size':61 'smaller':60 'stabl':21 'string':29 'suitabl':62 'support':26 'templat':28 'told':41 'transform':49 'uglifi':43 'uglifyjs/terser':46 'unless':39 'updat':25 'variabl':73 'version':16 'whitespac':69 'without':71","created_at":"2026-06-04T18:53:11.451685+00:00","updated_at":"2026-06-04T18:53:11.451685+00:00","problems":[{"fix":"Use require('nijm') instead.","cause":"Attempting to use ESM import syntax (import ... from 'nijm') which is not supported.","error":"SyntaxError: Unexpected token 'export'"},{"fix":"Use const nijm = require('nijm').default; or better, use CommonJS require.","cause":"Incorrectly imported as a default export from an ESM context that doesn't interop.","error":"nijm is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/manvalls/nijm#readme","github":"git://github.com/manvalls/nijm","docs":null,"changelog":null,"pypi":null,"npm":"nijm","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}