pretty-tree
Advanced tools
Comparing version 0.1.0 to 0.1.1
12
index.js
var archy = require('archy'); | ||
var colors = require('colors'); | ||
var chalk = require('chalk'); | ||
@@ -27,3 +27,3 @@ var isAtomic = function(v) { | ||
if (!atomic.length && !nonAtomic.length) return ['(empty)'.grey]; | ||
if (!atomic.length && !nonAtomic.length) return [chalk.grey('(empty)')]; | ||
@@ -33,7 +33,7 @@ atomic.forEach(function(key) { | ||
key = key+':'+pad.slice(key.length-pad.length-1); | ||
nodes.push(isArray ? val : (key.cyan+val)); | ||
nodes.push(isArray ? val : (chalk.cyan(key)+val)); | ||
}); | ||
nonAtomic.forEach(function(key) { | ||
nodes.push({label:isArray ? undefined : key.cyan, nodes:leaf(obj[key])}); | ||
nodes.push({label:isArray ? undefined : chalk.cyan(key), nodes:leaf(obj[key])}); | ||
}); | ||
@@ -45,3 +45,3 @@ | ||
var visit = function(node) { | ||
if (node.label) node.label = node.label.yellow; | ||
if (node.label) node.label = chalk.yellow(node.label); | ||
if (node.nodes) node.nodes = [].concat(node.nodes).map(visit); | ||
@@ -57,3 +57,3 @@ if (node.leaf) node.nodes = [].concat(node.nodes || [], leaf(node.leaf)); | ||
.replace(/[┬├─└│┐]/g, function(_) { | ||
return _.grey; | ||
return chalk.grey(_); | ||
}); | ||
@@ -60,0 +60,0 @@ }; |
{ | ||
"name": "pretty-tree", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Make colorful trees out of JSON objects using archy", | ||
@@ -8,3 +8,3 @@ "repository": "git://github.com/mafintosh/pretty-tree.git", | ||
"archy": "0.0.2", | ||
"colors": "~0.6.2" | ||
"chalk": "~0.4.0" | ||
}, | ||
@@ -11,0 +11,0 @@ "keywords": [ |
14104
+ Addedchalk@~0.4.0
+ Addedansi-styles@1.0.0(transitive)
+ Addedchalk@0.4.0(transitive)
+ Addedhas-color@0.1.7(transitive)
+ Addedstrip-ansi@0.1.1(transitive)
- Removedcolors@~0.6.2
- Removedcolors@0.6.2(transitive)