paths-tree

Creates tree of objects from a collection of file paths

npm install paths-tree
3 downloads in the last week
9 downloads in the last month

paths-tree

Transforms object with full paths as keys to nested (tree) object. Any values are merged into the node.

example

{
    'c:\foo\bar': {
        'something': 'else'
    }
}

is transformed into

{
    name: '',
    children: [{
        name: 'c:',
        children: [{
            name: 'foo',
            children: [{
                name: 'bar',
                something: 'else'
            }]
        }]
    }]
}

Copyright &2013; Gleb Bahmutov

npm loves you