Recursively builds a tree of object keys. Useful for creating lists or debugging.
npm i keys-tree --save
var keys = require('keys-tree');
keys({a: 'b', c: 'd'});
//=> { keys: [ 'a', 'c' ] }
keys({a: 'b', c: {d: 'e', f: 'g'}});
//=> { keys: [ 'a', 'c' ], c: { keys: [ 'd', 'f' ] } }
keys({a: 'b', c: {d: 'e', f: 'g', h: {i: 'j', k: 'l', m: 'n'}}});
// results in:
// { keys: [ 'a', 'c' ],
// c: { keys: [ 'd', 'f', 'h' ],
// h: { keys: [ 'i', 'k', 'm' ] } } }
a.b.c) get a nested value from an object.a.b.c paths.Install dev dependencies.
npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb-cli on March 22, 2015.