stringify-any

0.0.1 • Public • Published

Did you ever do this?

console.log(JSON.stringify(object))

This package supports this use case, except properly, so:

  • pretty printing by default
  • with final comma for all multiline data structures
  • support for special values like null, undefined, -0, infinities, NaN
  • support for Date, Map, and Set
  • partial support WeakMap, and WeakSet (full support is impossible without special engine hooks)

If you're in browser, the browser will usually provide a much better interface than this package. But if you need to print some objects to terminal, send them to logs etc., this package could be very useful.

Future plans

  • custom identation (not just 2 spaces)
  • support for other JS-style languages like Imba, CoffeeScript etc.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    1

Package Sidebar

Install

npm i stringify-any

Weekly Downloads

1

Version

0.0.1

License

ISC

Unpacked Size

5.85 kB

Total Files

4

Last publish

Collaborators

  • t-a-w