Skip to content
PHP's favorite print_r for JavaScript
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
README
package.json

README

JavaScript implementation of PHP's favorite function print_r()

example:
========

var print_r = require('print_r').print_r;

var a = {
  foo: 1,
  bar: function () {return 'hi';}
};

console.log(print_r(a));
//(object){
//    foo:(number)1,
//    bar:(function)function () {return 'hi';}}

todo:
=====

* the way it handles array seems to be wrong.
* write test.
* tag the version.
* is there a way to export functions into global easily?
* is it better to spit to console.log() defaultly as in PHP?
Something went wrong with that request. Please try again.