Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
hierarchical object inspection for node
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
History.md
Readme.md
index.js
package.json

Readme.md

Inspect

Tiny utility for node which outputs a hierarchical display of methods (accessors as well) and properties available. Comes in handy when using alien apis :)

Installation

$ npm install inspect

Example Output

[Admin]
  .first "tj"
  .last "holowaychuk"
  Admin
    .may(perm)
    User
      .may(perm)
      .name
      Object

Example JavaScript

var inspect = require('inspect');

function User(first, last) {
  this.first = first;
  this.last = last;
}

User.prototype.__defineGetter__('name', function(){
  return this.first + ' ' + this.last;
});

User.prototype.may = function(perm){
  return false;
};

function Admin(first, last) {
  User.call(this, first, last);
}

Admin.prototype.__proto__ = User.prototype;

Admin.prototype.may = function(perm){
  return true;
};

inspect(new Admin('tj', 'holowaychuk'));
Something went wrong with that request. Please try again.