Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cdir

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdir

An interactive console.dir() for the terminal.

  • 0.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Synopsis

An interactive representation of an object for the CLI similar to that of console.dir() in webkit.

Motivation

Why? Sometimes you have a lot of data that gets dumped to the screen. It's hard to keep track of it visually. A lot of the time you are just looking for one item in a sea of data. Progressive disclosure helps.

Usage

Navigation

First, require the module. Then use console.dir(somecode) in your program and then use tab or shift+tab to cycle through the object's members. You can hit space, return or enter to expand a member. See the example below.

Searching throught JSON

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) /.

How to quit

Hit ctrl+c or q to quit!

An example

There is a CLI version too if you want to use it. npm install cdir -g.


console.dir = require('../dir');

var stuff = { 
  "name" : "cdir", 
  "description" : "An interactive console.dir() for the terminal.",
  "tags" : [
    "console",
    "debug",
    "debugging",
    "json",
    "interacive",
    "prompt"
  ],
  "foo": function() { 
    return "node tests/test.js"
  }
};

console.dir(stuff);

The output looks something like this.

FAQs

Package last updated on 25 Apr 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc