@jsenv/humanize

1.0.0 • Public • Published

humanize npm package

@jsenv/humanize 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 { humanize } from "@jsenv/humanize";

console.log(
  humanize({
    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/humanize 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
'"' '"\""' '"'

Readme

Keywords

none

Package Sidebar

Install

npm i @jsenv/humanize

Weekly Downloads

78

Version

1.0.0

License

MIT

Unpacked Size

162 kB

Total Files

79

Last publish

Collaborators

  • jsenv-admin
  • dmail