keyson

1.0.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i keyson

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • linuxenko