Skip to content

Instantly share code, notes, and snippets.

@awwright
Forked from jonvuri/protoinspect.js
Created November 18, 2012 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awwright/4106486 to your computer and use it in GitHub Desktop.
Save awwright/4106486 to your computer and use it in GitHub Desktop.
Inspect prototypes
var util=require('util');
module.exports = function protoinspect(object, showHidden, depth, colors) {
return util.inspect(object, showHidden, depth, colors) + '\n' + (Object.getPrototypeOf(object)!=Object.prototype ? protoinspect(Object.getPrototypeOf(object), showHidden, depth, colors) : '');
}
module.exports.log = function protoinspectLog(object, showHidden, depth){
console.log(module.exports(object, showHidden, depth, true));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment