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

pretty-tree

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pretty-tree

Make colorful trees out of JSON objects using archy

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

pretty-tree

Make colorful trees out of JSON objects using archy

npm install pretty-tree

Usage

var tree = require('pretty-tree');

var str = tree({
	label: '(root)', // the label of this node
	nodes: [{
		label: '(child)',
		leaf: {
			hello: 'world',
			hej: 'verden'
		}
	}]
});

console.log(str);

The above example results in the following output:

example

The node passed to tree can contain the following options

tree({
	label: '(child)', // an optional lable of this node
	leaf: {           // set this if you want to print an object
		key: value,
		...
	},
	nodes: [          // or put in some child nodes
		child_nodes_with_same_structure
	]
})

If you want to disable coloring (even when the terminal is a tty) use tree.plain(options)

License

MIT

Keywords

FAQs

Package last updated on 24 Feb 2015

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