1.6.0 • Published 9 months ago
@jsenv/humanize v1.6.0
humanize 
@jsenv/humanize helps to generate messages meant to be read by humans
It is written in ES6 and compatible with browsers and Node.js.
API
humanize(jsValue)
Turns a JavaScript value into a string meant to be read by a human.
import { humanize } from "@jsenv/humanize";
console.log(
humanize({
boolean: true,
number: 10,
string: "hello world",
}),
);{
"boolean": true,
"number": 10,
"string": "hello world"
}Comparison with JSON.stringify
Table comparing JSON.stringify and humanize() to demonstrates how inspect focuses on readability and accuracy.
| value | JSON.stringify | humanize |
|---|---|---|
| 123456789 | "123456789" | 123_456_789 |
| Infinity | "null" | Infinity |
| -0 | "0" | -0 |
| '"' | '"\""' | '"' |
humanizeDuration(ms, options)
import { humanizeDuration } from "@jsenv/humanize";
humanizeDuration(61_421); // "1 minute and 1 second"1.5.2
9 months ago
1.6.0
9 months ago
1.5.1
9 months ago
1.5.0
9 months ago
1.4.0
10 months ago
1.3.1
10 months ago
1.3.0
10 months ago
1.2.0
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.2.8
1 year ago
1.2.7
1 year ago
1.2.6
1 year ago
1.2.5
1 year ago
1.2.4
1 year ago
1.2.3
2 years ago
1.1.3
2 years ago
1.2.1
2 years ago
1.1.2
2 years ago
1.0.0
2 years ago