1.0.0 • Published 9 years ago

path-tree v1.0.0

Weekly downloads
3
License
BSD
Repository
github
Last release
9 years ago

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}}
]