Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 57 lines (40 sloc) 1.466 kB
b113f8f first commit\!
Paolo Fragomeni authored
1 # Synopsis
2 An interactive representation of an object for the CLI similar to that of console.dir() in webkit.
3
4 # Motivation
ce6960d Update README.md
Paolo Fragomeni authored
5 Reading big object dumps is a waste of time. Progressive disclosure helps.
b113f8f first commit\!
Paolo Fragomeni authored
6
56968a8 Update README.md
Paolo Fragomeni authored
7 # Features
8 - Searchable/Repeat search
9 - Handles cyclical references
eecfc75 Update README.md
Paolo Fragomeni authored
10 - Expand and collapse nodes
56968a8 Update README.md
Paolo Fragomeni authored
11
b113f8f first commit\!
Paolo Fragomeni authored
12 # Usage
d07de4b [docs] update to docs
Paolo Fragomeni authored
13
ce6960d Update README.md
Paolo Fragomeni authored
14 ## Install
f3baea2 Update README.md
Paolo Fragomeni authored
15 Do `npm install cdir -g` and then require the module in your program like this `console.dir = require('cdir')`.
56968a8 Update README.md
Paolo Fragomeni authored
16
ce6960d Update README.md
Paolo Fragomeni authored
17 ## Navigate
18 Use `console.dir(someobject)` somewhere in your program and then hit `tab`, `shift+tab` or the arrow keys to cycle through the object's members. You can hit `space`, `return` or `enter` to expand a member.
b113f8f first commit\!
Paolo Fragomeni authored
19
ce6960d Update README.md
Paolo Fragomeni authored
20 ## Search
d07de4b [docs] update to docs
Paolo Fragomeni authored
21 Search by pressing the `/` key. This will display a `/` prompt. If you have already searched for something it will be displayed before the `/` prompt. For instance if you searched for "foobar" it would appear as `(foobar) /`.
22
ce6960d Update README.md
Paolo Fragomeni authored
23 ## Quit
a548e55 [doc] readme update, [lib] removed comment]
Paolo Fragomeni authored
24 Hit `ctrl+c` or `q` to quit!
25
56968a8 Update README.md
Paolo Fragomeni authored
26 ## Simple Example
f3d90bb Update README.md
Paolo Fragomeni authored
27 There is a CLI version too if you want to use it. `npm install cdir -g`.
f8cdd30 [lib] second
Paolo Fragomeni authored
28
b113f8f first commit\!
Paolo Fragomeni authored
29 ```js
30
7d7bb64 @KyleAMathews Fix require.
KyleAMathews authored
31 console.dir = require('cdir');
b113f8f first commit\!
Paolo Fragomeni authored
32
33 var stuff = {
6712571 cleanup
Paolo Fragomeni authored
34 "name" : "cdir",
b113f8f first commit\!
Paolo Fragomeni authored
35 "description" : "An interactive console.dir() for the terminal.",
36 "tags" : [
37 "console",
38 "debug",
39 "debugging",
40 "json",
41 "interacive",
42 "prompt"
274ee6f @dscape [docs fix] Missing `,`
dscape authored
43 ],
b113f8f first commit\!
Paolo Fragomeni authored
44 "foo": function() {
45 return "node tests/test.js"
46 }
47 };
48
49 console.dir(stuff);
50
f8cdd30 [lib] second
Paolo Fragomeni authored
51 ```
52
53 The output looks something like this.
54
0ea341b Update README.md
Paolo Fragomeni authored
55 <img src="https://github.com/hij1nx/cdir/raw/master/screenshot.png"/>
fd125f9 Update README.md
Paolo Fragomeni authored
56
Something went wrong with that request. Please try again.