
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
node-json-color-stringify
Advanced tools
Add a colorized version of JSON.stringify to JSON for console (Compatible with Windows and UNIX like systems).

node-json-color-stringify offers an alternative method to replace JSON.stringify method by a new one that highlights JSON content for console output.
npm install --save node-json-color-stringify
Colorized version is available as JSON.colorStringify:
require('node-json-color-stringify');
console.log(JSON.colorStringify({string: 'foo', nullElement: null, bool: false, integer: 42, array: ['Foo', 'bar']}));
Import node-json-color-stringify and use JSON.stringify as usual for non-colorized object output:
require('node-json-color-stringify');
console.log(JSON.stringify({string: 'foo', nullElement: null, bool: false, integer: 42, array: ['Foo', 'bar']}));
Replace array or function are also available:
require('node-json-color-stringify');
console.log(JSON.colorStringify(data, ['nullElement'], 2));
console.log(JSON.colorStringify(data, (key, value) => {
if (key === 'string') {
return undefined;
} else if (value === null) {
return 0;
}
return value;
}, 2));
Contributions welcome; Please submit all pull requests against the master branch. If your pull request contains JavaScript patches or features, you should include relevant unit tests.
René BIGOT
FAQs
JSON.stringify substitution to colorize output to STDOUT
We found that node-json-color-stringify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.