path-trie

data structure for path-addressable resources

path-trie

data structure for path-addressable resources

  var pathTrie = require('path-trie')
 
  var dictionary = {
    'a/b/c': 123
  }
  var trie = pathTrie(dictionary)
  // => { 
  //      a: { 
  //        b: { 
  //          c: { 
  //            '@': 123 
  //          } 
  //        } 
  //      } 
  //    } 
 
  dictionary = pathTrie.flatten(trie)
  // => { 
  //      'a/b/c': 123 
  //    } 
 

from is an optional path to flatten just a particular subtrie.

$ npm install path-trie

from project root:

$ npm install
$ npm test

MIT. (c) 2013 jden jason@denizac.org. See LICENSE.md