hierarchical object inspection for node
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
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'));