{"name":"pkg-store","description":"Use package.json as a config store.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/pkg-store","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/pkg-store.git"},"bugs":{"url":"https://github.com/jonschlinkert/pkg-store/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"data-store":"^0.13.0"},"devDependencies":{"gulp-format-md":"^0.1.5","mocha":"*"},"keywords":["config","data","get","json","package","package.json","package-json","pkg","set","store","update"],"verb":{"related":{"list":["data-store","find-pkg","normalize-pkg"]},"reflinks":["data-store"],"plugins":["gulp-format-md"],"layout":"default","toc":false},"gitHead":"c7f09f37004e76e76a166e1f4d9d0d8736409f2c","_id":"pkg-store@0.1.1","_shasum":"72b7dcf8d4bac7f5f1c00f3d645b2e1660663705","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"72b7dcf8d4bac7f5f1c00f3d645b2e1660663705","tarball":"http://registry-npm.ywwl.com/pkg-store/download/pkg-store-0.1.1.tgz","integrity":"sha512-xiTUgzOnK2zs9v8XnEUVFmZ2OjyQb7j/4JMvC9traIn83ldnuK2PRVNBfRbCGnTbkArei+GvM6vS4lnhQJeWzg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/sjclAgxDlL9HMVFs6YGcEBXpOI1kZn+XO9YvjjPKzAIhAPL+ylqNni9L6f76YNiK/n4/mYrp45Ss26XrjX/RK4V6"}],"size":2432,"noattachment":false,"key":"/pkg-store/-/pkg-store-0.1.1.tgz"},"directories":{},"readme":"# pkg-store [![NPM version](https://img.shields.io/npm/v/pkg-store.svg?style=flat)](https://www.npmjs.com/package/pkg-store) [![NPM monthly downloads](https://img.shields.io/npm/dm/pkg-store.svg?style=flat)](https://npmjs.org/package/pkg-store) [![NPM total downloads](https://img.shields.io/npm/dt/pkg-store.svg?style=flat)](https://npmjs.org/package/pkg-store) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/pkg-store.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/pkg-store)\n\n> Use package.json as a config store.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), 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 pkg-store\n```\n\n## Usage\n\n```js\nconst Pkg = require('pkg-store');\n```\n\n## API\n\nExtends [cache-base](https://github.com/jonschlinkert/cache-base), please see the `cache-base` documentation for more details.\n\n### [Pkg](index.js#L37)\n\nInitialize a new `Pkg` store at the given `cwd` with the specified `options`.\n\n**Params**\n\n* `cwd` **{String}**: Directory of the package.json to read.\n* `options` **{Object}**\n\n**Example**\n\n```js\nconst pkg = require('pkg-store')(process.cwd());\nconst pkg = new Pkg(cwd, options);\n// or\nconst pkg = new Pkg(options);\n\nconsole.log(pkg.path);\n//=> '~/your-project/package.json'\n\nconsole.log(pkg.data);\n//=> { name: 'your-project', ... }\n```\n\n### [.save](index.js#L63)\n\nWrite the `pkg.data` object to the file system at `pkg.path`.\n\n**Params**\n\n* `callback` **{Function}**: (optional)\n\n**Example**\n\n```js\npkg.save();\n```\n\n### [.read](index.js#L83)\n\nReads `pkg.path` from the file system and returns an object.\n\n* `returns` **{undefined}**\n\n**Example**\n\n```js\nconst data = pkg.read();\n```\n\n### .set\n\n```js\npkg.set(key, value);\n```\n\nSet property `key` with the given `value`.\n\n**Example**\n\n```js\n// given {\"name\": \"my-project\"}\npkg.set('bin.foo', 'bar');\n\nconsole.log(pkg.data);\n//=> {\"name\": \"my-project\", \"bin\": {\"foo\": \"bar\"}}\n```\n\n### .get\n\n```js\npkg.get(key);\n```\n\nGet property `key` from package.json.\n\n**Example**\n\n```js\n// given {\"name\": \"my-project\"}\npkg.set('bin.foo', 'bar');\n\nconsole.log(pkg.get('bin'));\n//=> {\"foo\": \"bar\"}\n```\n\n### .has\n\n```js\npkg.has(key);\n```\n\nReturns `true` if `package.json` has property `key`.\n\n**Example**\n\n```js\n// given: {\"name\": \"my-project\"}\nconsole.log(pkg.has('name'));\n//=> true\nconsole.log(pkg.has('zzzzzzz'));\n//=> false\n```\n\n### .union\n\n```js\npkg.union(key, val);\n```\n\nCreate array `key`, or concatenate values to array `key`. Also uniquifies the array.\n\n**Example**\n\n```js\npkg.union('keywords', 'foo');\npkg.union('keywords', ['bar', 'baz']);\n\nconsole.log(pkg.get('keywords'));\n//=> ['foo', 'bar', 'baz']\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<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### Related projects\n\nYou might also be interested in these projects:\n\n* [data-store](https://www.npmjs.com/package/data-store): Easily get, set and persist config data. | [homepage](https://github.com/jonschlinkert/data-store \"Easily get, set and persist config data.\")\n* [expand-pkg](https://www.npmjs.com/package/expand-pkg): Parse string values in package.json into objects. | [homepage](https://github.com/jonschlinkert/expand-pkg \"Parse string values in package.json into objects.\")\n* [find-pkg](https://www.npmjs.com/package/find-pkg): Find the first directory with a package.json, recursing up, starting with the given directory. Similar… [more](https://github.com/jonschlinkert/find-pkg) | [homepage](https://github.com/jonschlinkert/find-pkg \"Find the first directory with a package.json, recursing up, starting with the given directory. Similar to look-up but does not support globs and only searches for package.json. Async and sync.\")\n* [normalize-pkg](https://www.npmjs.com/package/normalize-pkg): Normalize values in package.json using the map-schema library. | [homepage](https://github.com/jonschlinkert/normalize-pkg \"Normalize values in package.json using the map-schema library.\")\n\n### Author\n\n**Jon Schlinkert**\n\n* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert)\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\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.6.0, on December 21, 2017._","publish_time":1453540570919,"_cnpm_publish_time":1453540570919,"dist-tags":{"latest":"1.0.1"}}