1.0.1 • Published 8 years ago

print_r-json v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

print_r-json

An approximate equivalent of PHP's print_r function, pretty-prints almost any type as JSON. Parameters and returns are the same as for the PHP original. Functions are ignored.

Reference: http://php.net/manual/en/function.print-r.php

Example:

const print_r = require('print_r-json');
const test = { name: 'Dave', num: 12345, bool: true, func: something => console.log(something) };
print_r(test);

{
  "name": "Dave",
  "num": 12345,
  "bool": true
}
1.0.1

8 years ago

1.0.0

8 years ago