{"name":"set-getter","description":"Create nested getter properties and any intermediary dot notation (`'a.b.c'`) paths","version":"0.1.0","homepage":"https://github.com/doowb/set-getter","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git+https://github.com/doowb/set-getter.git"},"bugs":{"url":"https://github.com/doowb/set-getter/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"to-object-path":"^0.3.0"},"devDependencies":{"gulp-format-md":"^0.1.9","mocha":"^2.4.5"},"keywords":[],"verb":{"plugins":["gulp-format-md"],"reflinks":["verb","set-value"],"layout":"default","toc":false,"tasks":["readme"],"lint":{"reflinks":true}},"gitHead":"bfdd988ef9aa472ff05d6d6c7501c33bc36dc39e","_id":"set-getter@0.1.0","_shasum":"d769c182c9d5a51f409145f2fba82e5e86e80376","_from":".","_npmVersion":"3.7.5","_nodeVersion":"5.1.1","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"d769c182c9d5a51f409145f2fba82e5e86e80376","tarball":"http://registry-npm.ywwl.com/set-getter/download/set-getter-0.1.0.tgz","integrity":"sha512-lIj6AWViymAQLQyq1qehP44w4iGbSv6pYOKRQCDzqlmxctLyCrecuge0bxRPrNSnV8EeMHKR2fVTRl3LniQLNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBYYhY0MPaYz8+8TfdALMSqyPJmje514IxWVjl/5lcCAIhANBW299l4iaYCEtG/zxANgZ66aLfL6AB26ksebTeymKC"}],"size":2711,"noattachment":false,"key":"/set-getter/-/set-getter-0.1.0.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/set-getter-0.1.0.tgz_1461947468848_0.7060375646688044"},"directories":{},"readme":"# set-getter [![NPM version](https://img.shields.io/npm/v/set-getter.svg?style=flat)](https://www.npmjs.com/package/set-getter) [![NPM monthly downloads](https://img.shields.io/npm/dm/set-getter.svg?style=flat)](https://npmjs.org/package/set-getter) [![NPM total downloads](https://img.shields.io/npm/dt/set-getter.svg?style=flat)](https://npmjs.org/package/set-getter) [![Linux Build Status](https://img.shields.io/travis/doowb/set-getter.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/set-getter)\n\n> Create nested getter properties and any intermediary dot notation (`'a.b.c'`) paths\n\nPlease consider following this project's author, [Brian Woodward](https://github.com/doowb), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save set-getter\n```\n\n## Usage\n\n```js\nvar getter = require('set-getter');\n```\n\nset-getter works like [set-value](https://github.com/jonschlinkert/set-value) by adding a property to an object or an object hierarchy using dot notation. The main difference is that the property is added using `Object.defineProperty` and is expected to be a getter function that returns a value.\n\n**Example**\n\n```js\nvar obj = {};\n\n// root level property\ngetter(obj, 'foo', function() {\n  return 'bar';\n});\nconsole.log(obj.foo);\n//=> 'bar'\n\n// property dot notation\ngetter(obj, 'bar.baz', function() {\n  return 'qux';\n});\nconsole.log(obj.bar.baz);\n//=> 'qux'\n\n// property array notation\ngetter(obj, ['beep', 'boop'], function() {\n  return 'bop';\n});\nconsole.log(obj.beep.boop);\n//=> 'bop'\n```\n\n## API\n\n### [setGetter](index.js#L31)\n\nDefines a getter function on an object using property path notation.\n\n**Params**\n\n* `obj` **{Object}**: Object to add property to.\n* `prop` **{String|Array}**: Property string or array to add.\n* `getter` **{Function}**: Getter function to add as a property.\n\n**Example**\n\n```js\nvar obj = {};\ngetter(obj, 'foo', function() {\n  return 'bar';\n});\n```\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Author\n\n**Brian Woodward**\n\n* [GitHub Profile](https://github.com/doowb)\n* [Twitter Profile](https://twitter.com/doowb)\n* [LinkedIn Profile](https://linkedin.com/in/woodwardbrian)\n\n### License\n\nCopyright © 2021, [Brian Woodward](https://github.com/doowb).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on June 18, 2021._","publish_time":1461947471220,"_cnpm_publish_time":1461947471220,"dist-tags":{"latest":"0.1.1"}}