2.0.0 • Published 4 months ago
@jsenv/inspect v2.0.0
inspect
@jsenv/inspect
turns a JavaScript value into a string meant to be read by a human. It is written in ES6 and compatible with browsers and Node.js.
import { inspect } from "@jsenv/inspect";
console.log(
inspect({
boolean: true,
number: 10,
string: "hello world",
}),
);
❯ node ./docs/demo.mjs
{
"boolean": true,
"number": 10,
"string": "hello world"
}
Comparison with JSON.stringify
Table comparing JSON.stringify
and @jsenv/inspect
to demonstrates how inspect focuses on readability and accuracy.
value | JSON.stringify | jsenv inspect |
---|---|---|
123456789 | "123456789" | 123_456_789 |
Infinity | "null" | Infinity |
-0 | "0" | -0 |
'"' | '"\""' | '"' |
2.0.0
4 months ago
1.9.1
6 months ago
1.9.0
8 months ago
1.8.0
8 months ago
1.7.3
1 year ago
1.7.2
2 years ago
1.7.1
2 years ago
1.7.0
2 years ago
1.6.0
3 years ago
1.5.0
3 years ago
1.4.1
3 years ago
1.3.1
4 years ago
1.3.0
4 years ago
1.2.2
4 years ago
1.2.0
4 years ago
1.2.1
4 years ago
1.1.1
4 years ago
1.1.0
5 years ago
1.0.0
5 years ago