path-tree
v1.0.0
Published
Data structure for manipulating directory trees
Downloads
2
Readme
path-tree
Immutable data structure for manipulating directory trees.
usage
var PathTree = require('path-tree');
var t = new PathTree();
t = t.set('/docs/index.html', {'status': 400});
t = t.set('/news/cat-goes-on-rampage', {'status': 500});
t = t.set('/logs/access.log', {'status': 200});
t.get('/docs/index.html');
-> {'status': 400}
t.leaves();
-> [
{'path': '/docs/index.html', 'value': {'status': 400}},
{'path': '/news/cat-goes-on-rampage', 'value': {'status': 500}},
{'path': '/logs/access.log', 'value': {'status': 200}}
]