{"name":"dlv","version":"1.0.2","description":"Safely get a dot-notated property within an object.","main":"dist/dlv.js","browser":"dist/dlv.umd.js","jsnext:main":"index.js","scripts":{"build":"mkdir -p dist && npm run -s build:cjs && npm run -s build:umd","build:cjs":"rollup -i $npm_package_jsnext_main -f cjs --no-strict | uglifyjs -cm -o $npm_package_main","build:umd":"rollup -i $npm_package_jsnext_main -n $npm_package_name -f umd --no-strict | uglifyjs -cm -o $npm_package_browser","prepublish":"npm run build","test":"node test","release":"npm run build && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"keywords":["delve","dot notation","dot"],"files":["index.js","dist"],"author":{"name":"Jason Miller","email":"jason@developit.ca","url":"http://jasonformat.com"},"repository":{"type":"git","url":"git+https://github.com/developit/dlv.git"},"license":"MIT","devDependencies":{"rollup":"^0.34.3","uglifyjs":"^2.4.10"},"gitHead":"886103562e4466f31f0d491cd8932720542d98d9","bugs":{"url":"https://github.com/developit/dlv/issues"},"homepage":"https://github.com/developit/dlv#readme","_id":"dlv@1.0.2","_shasum":"83c9209ced992af8489b688ac8aa207f2530cd1a","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"developit","email":"jason@developit.ca"},"maintainers":[{"name":"developit","email":"jason@developit.ca"}],"dist":{"shasum":"83c9209ced992af8489b688ac8aa207f2530cd1a","tarball":"http://registry-npm.ywwl.com/dlv/download/dlv-1.0.2.tgz","integrity":"sha512-Gxp3+Cn0NVukoMvmQnNSDVROyc2S9CVlfe2mto4HijP+rD2IrgUvHlQxEPCIH4dTWWcQFweK7CHN2z1X9MbGEQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIESkfnldI7h1W10Cwu8pCvBClm8AS9dEXMTfZzDje2WNAiAE4mWs1D72js7kqDkTnM1vUAJutgvHCUetFot3laj8/g=="}],"size":2165,"noattachment":false,"key":"/dlv/-/dlv-1.0.2.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/dlv-1.0.2.tgz_1470279985686_0.9652429856359959"},"directories":{},"readme":"# `dlv(obj, keypath)` [![NPM](https://img.shields.io/npm/v/dlv.svg)](https://npmjs.com/package/dlv) [![Build](https://travis-ci.org/developit/dlv.svg?branch=master)](https://travis-ci.org/developit/dlv)\n\n> Safely get a dot-notated path within a nested object, with ability to return a default if the full key path does not exist or the value is undefined\n\n\n### Why?\n\nSmallest possible implementation: only **130 bytes.**\n\nYou could write this yourself, but then you'd have to write [tests].\n\nSupports ES Modules, CommonJS and globals.\n\n\n### Installation\n\n`npm install --save dlv`\n\n\n### Usage\n\n`delve(object, keypath, [default])`\n\n```js\nimport delve from 'dlv';\n\nlet obj = {\n\ta: {\n\t\tb: {\n\t\t\tc: 1,\n\t\t\td: undefined,\n\t\t\te: null\n\t\t}\n\t}\n};\n\n//use string dot notation for keys\ndelve(obj, 'a.b.c') === 1;\n\n//or use an array key\ndelve(obj, ['a', 'b', 'c']) === 1;\n\ndelve(obj, 'a.b') === obj.a.b;\n\n//returns undefined if the full key path does not exist and no default is specified\ndelve(obj, 'a.b.f') === undefined;\n\n//optional third parameter for default if the full key in path is missing\ndelve(obj, 'a.b.f', 'foo') === 'foo';\n\n//or if the key exists but the value is undefined\ndelve(obj, 'a.b.d', 'foo') === 'foo';\n\n//Non-truthy defined values are still returned if they exist at the full keypath\ndelve(obj, 'a.b.e', 'foo') === null;\n\n//undefined obj or key returns undefined, unless a default is supplied\ndelve(undefined, 'a.b.c') === undefined;\ndelve(undefined, 'a.b.c', 'foo') === 'foo';\ndelve(obj, undefined, 'foo') === 'foo';\n```\n\n\n### Setter Counterparts\n\n- [dset](https://github.com/lukeed/dset) by [@lukeed](https://github.com/lukeed) is the spiritual \"set\" counterpart of `dlv` and very fast.\n- [bury](https://github.com/kalmbach/bury) by [@kalmbach](https://github.com/kalmbach) does the opposite of `dlv` and is implemented in a very similar manner.\n\n\n### License\n\n[MIT](https://oss.ninja/mit/developit/)\n\n\n[preact]: https://github.com/developit/preact\n[tests]: https://github.com/developit/dlv/blob/master/test.js\n","publish_time":1470279987142,"_cnpm_publish_time":1470279987142,"dist-tags":{"latest":"1.1.3"}}