1.0.2 • Published 7 years ago

keyson v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

keyson

npm Travis Coveralls David

Access nested json objects using simple string based paths.

Installation

npm install keyson

Usage

keyson(object, key [,separator]

  var obj = {
    name : 'test',
    test : [
      'hello',
      'world',
      { nested : [1, 2, 3] }
    ]
  };


  keyson(obj, 'name'); // test
  keyson(obj, 'test.0'); //hello
  keyson(obj, 'test.2.nested.2'); // 3

License

MIT (c) Svetlana Linuxenko