{"_id":"propget","_rev":"269053","name":"propget","description":"Use dot notation to get properties from deeply nested object and array structures.","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"3rdeden","email":""},{"name":"npm:3rdeden","email":""}],"time":{"modified":"2023-06-28T12:13:46.000Z","created":"2015-06-22T11:57:06.347Z","1.1.0":"2017-01-02T16:43:33.027Z","1.0.0":"2015-06-22T11:57:06.347Z"},"users":{},"author":{"name":"Arnout Kazemier"},"repository":{"type":"git","url":"git+https://github.com/bigpipe/propget.git"},"versions":{"1.1.0":{"name":"propget","version":"1.1.0","description":"Use dot notation to get properties from deeply nested object and array structures.","main":"index.js","scripts":{"test":"mocha test.js"},"repository":{"type":"git","url":"git+https://github.com/bigpipe/propget.git"},"keywords":["prop","property","get"],"author":{"name":"Arnout Kazemier"},"license":"MIT","bugs":{"url":"https://github.com/bigpipe/propget/issues"},"homepage":"https://github.com/bigpipe/propget#readme","devDependencies":{"assume":"1.4.x","mocha":"3.2.x","pre-commit":"1.2.x"},"gitHead":"194bfa11d43f2850c7d7a18ba4b1fada7377d793","_id":"propget@1.1.0","_shasum":"6c1c7ac9a09c05bdb5c967f0cd8e1c09409fef6b","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.1","_npmUser":{"name":"3rdeden","email":"npm@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":""},{"name":"npm:3rdeden","email":""}],"dist":{"shasum":"6c1c7ac9a09c05bdb5c967f0cd8e1c09409fef6b","size":3042,"noattachment":false,"key":"/propget/-/propget-1.1.0.tgz","tarball":"http://name.csiicloud.com:7001/propget/download/propget-1.1.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/propget-1.1.0.tgz_1483375410923_0.5275575704872608"},"directories":{},"publish_time":1483375413027,"_hasShrinkwrap":false,"_cnpm_publish_time":1483375413027,"_cnpmcore_publish_time":"2021-12-16T22:54:41.021Z"},"1.0.0":{"name":"propget","version":"1.0.0","description":"Use dot notation to get properties from deeply nested object and array structures.","main":"index.js","scripts":{"test":"mocha test.js"},"repository":{"type":"git","url":"git+https://github.com/bigpipe/propget.git"},"keywords":["prop","property","get"],"author":{"name":"Arnout Kazemier"},"license":"MIT","bugs":{"url":"https://github.com/bigpipe/propget/issues"},"homepage":"https://github.com/bigpipe/propget#readme","devDependencies":{"assume":"1.2.x","mocha":"2.2.x","pre-commit":"1.0.x"},"gitHead":"2268079a4181cb93705f73f60b617d0a31421b24","_id":"propget@1.0.0","_shasum":"d003512445efb813eabc29989cd5ecf715679f42","_from":".","_npmVersion":"2.9.1","_nodeVersion":"0.12.3","_npmUser":{"name":"3rdeden","email":"npm@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":""},{"name":"npm:3rdeden","email":""}],"dist":{"shasum":"d003512445efb813eabc29989cd5ecf715679f42","size":2342,"noattachment":false,"key":"/propget/-/propget-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/propget/download/propget-1.0.0.tgz"},"directories":{},"publish_time":1434974226347,"_hasShrinkwrap":false,"_cnpm_publish_time":1434974226347,"_cnpmcore_publish_time":"2021-12-16T22:54:41.306Z"}},"readme":"# propget\n\nPropget is a small helper utility for finding values/keys in deeply nested\nobjects without having to worry about undefined properties and what not. It uses\na human readable dot based notation to find items in your object or array.\n\n## Installation\n\nJust install it through npm, like you do with the all your code:\n\n```\nnpm install --save propget\n```\n\nIt doesn't use any fancy node.js magic or ES6 so it should be good to go for\nbrowser usage as well using something as browserify.\n\n## Usage\n\nUsing the module is super simple. We export the `propget` method as default\nfunction:\n\n```js\nvar propget = require('propget');\n```\n\nThe function accepts the following arguments:\n\n- `object`, data structure that we need to walk.\n- `string`, dot notated string for deeply nested object access.\n- `..`, rest arguments that will be used for optional function calls.\n\nSo accessing a complex data structure can be as easy as this:\n\n```js\n'use strict';\n\nvar prop = require('propget')\n  , data = { hello: 'world', yo: { deeply: ['nested', 'arrays'] } };\n\nprop(data, 'hello'); // world\nprop(data, 'yo.deeply.1'); // arrays\nprop(data, 'yo.deeply.nested.unknown.keys'); // undefined\n```\n\n#### Function execution\n\nOf one the unique functions of this module is that it allows you to execute\nfunctions that are inside data structure. We can then re-use the result of the\nfunction and walk it further.\n\n```js\ndata = { \n  hello: { \n    world: function () { \n      return { \n        hi: 'hello'\n      };\n    }\n  }\n};\n\nprop(data, 'hello.world().hi') // hello\n```\n\nBut in addition to simple function execution we can also call these functions\nwith arguments. We automatically use the additionally supplied arguments to the\npropget method for this.\n\n```js\ndata = { \n  hello: { \n    world: function (arg) { \n      return { \n        hi: arg\n      };\n    }\n  }\n};\n\nprop(data, 'hello.world(what).hi', 'additional') // additional\n```\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/bigpipe/propget#readme","bugs":{"url":"https://github.com/bigpipe/propget/issues"},"license":"MIT"}