New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

treet

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

treet

Formats objects as trees.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Treet formats objects as trees, which is apparently a really difficult concept to understand sometimes.

Install:

npm install treet

Require:

var treet = require('treet');

Use:

console.log(treet({a: {complicatedly: {nested: ['object']}}}));

Output:

Object
  a: Object
    complicatedly: Object
      nested: Array
        0: "object"

Handles circular references by pointing to the location of the circular referencee above the circular referencer. For example:

var obj = {};
obj.obj = {obj: obj};
console.log(treet(obj));

would output:

Object
  obj: Object
    obj: .obj

Numerical indices in strings only are ignored; negative zero is displayed as -0; strings are displayed JSON-encoded; numbers, dates, and regular expressions are displayed as one would expect; anything else is given by the name of its constructor.

Keywords

tree

FAQs

Package last updated on 08 Mar 2013

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