This repository was archived by the owner on May 17, 2023. It is now read-only.
beatak/print_r
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
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?