{"name":"dlv","version":"1.1.2","description":"Safely get a dot-notated property within an object.","main":"dist/dlv.js","browser":"dist/dlv.umd.js","module":"dist/dlv.es.js","scripts":{"dev":"microbundle watch","build":"microbundle","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":{"microbundle":"^0.4.1"},"gitHead":"66258e3ba1f9d1b52277dd902e8e90c625e4b354","bugs":{"url":"https://github.com/developit/dlv/issues"},"homepage":"https://github.com/developit/dlv#readme","_id":"dlv@1.1.2","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"developit","email":"jason@developit.ca"},"dist":{"integrity":"sha512-xxD4VSH67GbRvSGUrckvha94RD7hjgOH7rqGxiytLpkaeMvixOHFZTGFK6EkIm3T761OVHT8ABHmGkq9gXgu6Q==","shasum":"270f6737b30d25b6657a7e962c784403f85137e5","tarball":"http://registry-npm.ywwl.com/dlv/download/dlv-1.1.2.tgz","fileCount":9,"unpackedSize":5327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGD/hCRA9TVsSAnZWagAAdJsP/j1PhryJQ9vWDl0XDCl3\nzlO4F4Z3lhUCjt7puIK3jLnai40NI6Rhi7J8YJP829Q8Naq0SuRqb3PazbKO\nKXeCb1Q+kfmqHjQFhM9ryWIIdglD/DIFziYhARnUePAbACFBDH/RCtnfCvun\ndo6kHegyPQUzuwsSMTkb10Tbc5kd5ApwUF2yyX0pykWUiPEZyEK2ATdtsAKh\n7PMiMQabKsijSjKIM5JProDaUG2WoCS4QVmPH/mgeo9/yRr3c24jSEOwtf5C\nE4vnwzdCjFF/y5kAocyfz+zXXU8kO8MB56kvG/LXfKLunhhzOyMDf8H1HLDh\ni1QZbDT3I6kIHEYRhEvmSVU78w2paHjFCaR2oHIcxfyuF6HTv0QsN7P3YN0L\n7Q94NQVLC1B6X0iyrpU9PRDyQtWtwqVG/TpB2FUUrcgFBFzazSJP8LkzT6I2\nMSQIW7YKNcDPejCws+2Wq+xhYDZjPY+nJhZAOKZDoXMh+uD+Zkc4dfVmiW8u\n2lT91etHcgfyxhBQOtxZxi30U3xCzFmzFOersm9xugaXpcFKREn327u35H/J\nNOiJ+HjbXApM0EvzZOFI6DfWoPl+FnUKPfhde37kDts5LJwYCWi4TTS6Ctkf\ntCo0N/U8Xpc36pQN8iw2KdPniuaJI7ni252rNiHXa2BST9N52RgMoI0dxZQ6\n26Bw\r\n=Ekua\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJyAzIG8pNXad1oVhv8G4RDo9STBbjcN4bJq+BB6OGrAiBYZkMiLBxT0/wI3EfuA/UzqgUxEIK9IU/cDKlsqQbI6w=="}],"size":2158,"noattachment":false,"key":"/dlv/-/dlv-1.1.2.tgz"},"maintainers":[{"name":"developit","email":"jason@developit.ca"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dlv_1.1.2_1528315870656_0.8448732983003138"},"_hasShrinkwrap":false,"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":1528315870799,"_cnpm_publish_time":1528315870799,"dist-tags":{"latest":"1.1.3"}}