{"name":"pathval","version":"0.1.1","description":"Object value retrieval given a string path","main":"./index.js","homepage":"https://github.com/chaijs/pathval","scripts":{"test":"hydro","coverage":"istanbul cover _hydro","coveralls":"istanbul cover _hydro --report lcovonly && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","test-readme":"jsmd README.md"},"repository":{"type":"git","url":"https://github.com/chaijs/pathval"},"devDependencies":{"coveralls":"~2.3.0","istanbul":"~0.1.44","jsmd":"~0.2.0","simple-assert":"~1.0.0","hydro":"~0.8.7","hydro-file-suite":"0.0.1","hydro-doc":"0.0.2","hydro-bdd":"0.0.3"},"author":{"name":"Veselin Todorov","email":"hi@vesln.com"},"license":"MIT","readme":"[![NPM version](https://badge.fury.io/js/pathval.png)](http://badge.fury.io/js/pathval)\n[![Build Status](https://secure.travis-ci.org/chaijs/pathval.png)](http://travis-ci.org/chaijs/pathval)\n[![Coverage Status](https://coveralls.io/repos/chaijs/pathval/badge.png?branch=master)](https://coveralls.io/r/chaijs/pathval?branch=master)\n[![Code Climate](https://codeclimate.com/github/chaijs/pathval.png)](https://codeclimate.com/github/chaijs/pathval)\n\n# pathval\n\n## Usage\n\n```\nvar props = require('pathval');\n```\n\nGiven:\n\n```js\nvar obj = {\n    prop1: {\n        arr: ['a', 'b', 'c']\n      , str: 'Hello'\n    }\n  , prop2: {\n        arr: [ { nested: 'Universe' } ]\n      , str: 'Hello again!'\n    }\n}\n\nvar arr = [ { foo: 'bar' } ];\n```\n\nExpect:\n\n<!-- js\n  var props = require('./');\n-->\n\n#### get\n\n```js\nprops.get(obj, 'prop1.str'); // => \"Hello\"\nprops.get(obj, 'prop1.arr[2]'); // => \"c\"\nprops.get(obj, 'prop2.arr[0].nested'); // => \"Universe\"\n\nprops.get(arr, '[0].foo'); // => \"bar\"\n\nprops.get(undefined, 'doesnt.matter'); // => undefined\nprops.get({}, 'doesnt.exist'); // => undefined\n```\n\n#### set\n\n```js\nprops.set(obj, 'hello.universe', 'properties');\nprops.set(obj, 'hello.universe[1].properties', 'galaxy');\nprops.set(obj, 'hello', 'universe');\nprops.set(obj, 'hello[0]', 1);\nprops.set(obj, 'hello[2]', 3);\n```\n\n## Installation\n\n```bash\nnpm install pathval\n```\n\n## Tests\n\n### Running the tests\n\n```bash\n$ npm test\n```\n\n### Test coverage\n\n```bash\n$ npm run-script coverage\n```\n\n### Readme tests\n\n```bash\n$ npm run-script test-readme\n```\n\n## License\n\nMIT License\n\nCopyright (c) 2011-2013 Jake Luer jake@alogicalparadox.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial\nportions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\nTHE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/chaijs/pathval/issues"},"_id":"pathval@0.1.1","_shasum":"08f911cdca9cce5942880da7817bc0b723b66d82","_from":"https://registry.npmjs.org/pathval/-/pathval-0.1.1.tgz","_resolved":"https://registry.npmjs.org/pathval/-/pathval-0.1.1.tgz"}