{"_id":"set-getter","_rev":"386929","name":"set-getter","description":"Create nested getter properties and any intermediary dot notation (`'a.b.c'`) paths","dist-tags":{"latest":"0.1.1"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-08-04T03:29:16.000Z","created":"2016-04-29T16:31:11.220Z","0.1.1":"2021-06-18T13:34:07.648Z","0.1.0":"2016-04-29T16:31:11.220Z"},"users":{},"author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git+https://github.com/doowb/set-getter.git"},"versions":{"0.1.1":{"name":"set-getter","description":"Create nested getter properties and any intermediary dot notation (`'a.b.c'`) paths","version":"0.1.1","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","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":"43fc06a8baf3851e9639c191ed8dcf38ec421324","_id":"set-getter@0.1.1","_nodeVersion":"15.5.1","_npmVersion":"7.3.0","dist":{"shasum":"a3110e1b461d31a9cfc8c5c9ee2e9737ad447102","size":3055,"noattachment":false,"key":"/set-getter/-/set-getter-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/set-getter/download/set-getter-0.1.1.tgz"},"_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"directories":{},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/set-getter_0.1.1_1624023247506_0.7570796555927348"},"_hasShrinkwrap":false,"publish_time":1624023247648,"_cnpm_publish_time":1624023247648},"0.1.0":{"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","size":2711,"noattachment":false,"key":"/set-getter/-/set-getter-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/set-getter/download/set-getter-0.1.0.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/set-getter-0.1.0.tgz_1461947468848_0.7060375646688044"},"directories":{},"publish_time":1461947471220,"_cnpm_publish_time":1461947471220,"_hasShrinkwrap":false}},"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._","_attachments":{},"homepage":"https://github.com/doowb/set-getter","bugs":{"url":"https://github.com/doowb/set-getter/issues"},"license":"MIT"}