Registry / devops / json-nice

json-nice

JSON →
library1.1.0jsnpmunverified

json-nice is a simple JSON formatting library (v1.1.0) that pretty-prints JavaScript objects with customizable indentation. It supports options like indent character and size. No breaking changes known. Minimal alternative to built-in JSON.stringify with more control over formatting.

npm install json-nice
INSTALL
IMPORT
SIG · JSON-NICE
J
json-nice
devopsjavascriptv1.1.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.

format
const format = require('json-nice');
import format from 'json-nice';
CommonJS only; no ES module support.
default
const format = require('json-nice'); format(obj, options);
format(obj);
No named export, only default export as a function.

Shows basic usage of json-nice to format a JavaScript object with custom indentation.

const format = require('json-nice'); const obj = { hello: 'world', nested: { foo: 'bar' } }; const options = { indent: 2 }; console.log(format(obj, options));
Debug
Known issues
gotchaLibrary is CommonJS only; does not support ES module imports.
fix
Use require() instead of import.
affects: >=1.0
gotchaNo TypeScript type definitions; may require manual declaration.
fix
Create a .d.ts file or use @ts-ignore.
affects: *
Errors
Common errors & fixes
TypeError: format is not a function
Using ES module import incorrectly.
fix
Use const format = require('json-nice'); instead of import.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
Amazon
1
Resources
json-nice — npm install json-nice · libregistry