Registry / devops / package.json-minifier

package.json-minifier

JSON →
library0.0.4jsnpmunverified

A zero-config CLI tool that minifies a project's package.json by removing whitespace and comments, moving the result to dist/package.json. It also strips the 'files' field under the assumption that all necessary files are already copied into the dist directory. Version 0.0.4 is the latest, with no active development observed. Use with caution as it may remove fields you depend on. Ideal for build pipelines where a lean package.json is needed for published artifacts.

npm install package.json-minifier
INSTALL
IMPORT
SIG · PACKAGE.JSON-MINIF
P
package.json-minifier
devopsjavascriptv0.0.4
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.

package.json-minifier
npx package.json-minifier
npm install package.json-minifier && package.json-minifier
Best used via npx to avoid global install. It's a CLI tool, not a library.

Shows how to invoke the tool via npx. It minifies package.json and removes the 'files' field, outputting to dist/package.json.

# Run package.json-minifier in your project root npx package.json-minifier # This will create a minified dist/package.json without the 'files' field.
Debug
Known issues
breakingThe 'files' field is automatically removed from the minified package.json.
fix
If you need the 'files' field, manually add it back after minification or avoid using this tool.
affects: >=0.0.1
gotchaThis tool was last updated years ago and has no active maintenance. Use at your own risk.
fix
Consider using an alternative like json-minify or implement your own minification.
affects: 0.0.4
deprecatedThe tool only handles package.json minification and does not preserve comments or formatting beyond stripping whitespace.
fix
For full-featured JSON minification, use a general JSON minifier instead.
affects: 0.0.4
Errors
Common errors & fixes
package.json-minifier: command not found
Not using npx or not having the package installed globally.
fix
Use npx package.json-minifier or install globally with npm install -g package.json-minifier
Cannot find module 'package.json-minifier'
Attempting to import as a Node module in code, but it's a CLI tool.
fix
Run npx package.json-minifier from terminal, not import in code.
Upgrade
Version history
0.0.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
package.json-minifier — npm install package.json-minifier · libregistry