{"_id":"pkg-store","_rev":"80685","name":"pkg-store","description":"Use package.json as a config store.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:25:47.000Z","created":"2015-12-23T00:57:09.617Z","1.0.1":"2017-12-21T08:21:29.255Z","1.0.0":"2017-12-21T08:07:18.714Z","0.2.2":"2016-04-13T06:40:10.916Z","0.2.1":"2016-03-31T17:59:49.327Z","0.2.0":"2016-03-31T02:08:09.541Z","0.1.2":"2016-02-04T07:16:43.603Z","0.1.1":"2016-01-23T09:16:10.919Z","0.1.0":"2015-12-23T00:57:09.617Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/pkg-store.git"},"versions":{"1.0.1":{"name":"pkg-store","description":"Use package.json as a config store.","version":"1.0.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":">=6"},"scripts":{"test":"mocha"},"dependencies":{"cache-base":"^2.0.2","write-json":"^2.0.0"},"devDependencies":{"delete":"^1.1.0","gulp-format-md":"^1.0.0","mocha":"^3.5.3"},"keywords":["config","data","get","json","package","package-json","package.json","pkg","set","store","update"],"verb":{"run":true,"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["data-store","expand-pkg","find-pkg","normalize-pkg"]},"lint":{"reflinks":true}},"gitHead":"913beebdcba791500417d478e8a7419bedab0a9c","_id":"pkg-store@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.1.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"fc1422db7eca6ba5a7ca5a7d6ea4049123d0b55a","size":3665,"noattachment":false,"key":"/pkg-store/-/pkg-store-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-store/download/pkg-store-1.0.1.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pkg-store-1.0.1.tgz_1513844489155_0.42462411313317716"},"directories":{},"publish_time":1513844489255,"_hasShrinkwrap":false,"_cnpm_publish_time":1513844489255},"1.0.0":{"name":"pkg-store","description":"Use package.json as a config store.","version":"1.0.0","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":">=6"},"scripts":{"test":"mocha"},"dependencies":{"cache-base":"^2.0.2","write-json":"^2.0.0"},"devDependencies":{"delete":"^1.1.0","gulp-format-md":"^1.0.0","mocha":"^3.5.3"},"keywords":["config","data","get","json","package","package-json","package.json","pkg","set","store","update"],"verb":{"run":true,"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["data-store","expand-pkg","find-pkg","normalize-pkg"]},"lint":{"reflinks":true}},"gitHead":"c423e0049f11a90f432afc4fe007431dc42c0744","_id":"pkg-store@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.1.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"4674dbfaf95bcadd847d7863296d1dcc853e5fa2","size":3682,"noattachment":false,"key":"/pkg-store/-/pkg-store-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-store/download/pkg-store-1.0.0.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pkg-store-1.0.0.tgz_1513843637862_0.35389252193272114"},"directories":{},"publish_time":1513843638714,"_hasShrinkwrap":false,"_cnpm_publish_time":1513843638714},"0.2.2":{"name":"pkg-store","description":"Use package.json as a config store.","version":"0.2.2","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","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"cache-base":"^0.8.2","kind-of":"^3.0.2","lazy-cache":"^1.0.3","union-value":"^0.2.3","write-json":"^0.2.2"},"devDependencies":{"delete":"^0.3.0","gulp-format-md":"^0.1.7","mocha":"^2.4.5"},"keywords":["config","data","get","json","package","package.json","package-json","pkg","set","store","update"],"verb":{"run":true,"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["data-store","find-pkg","expand-pkg","normalize-pkg"]},"reflinks":["verb","cache-base"],"lint":{"reflinks":true}},"gitHead":"1b6591d71187ea6bf2da7dc8b973a3910956fbb7","_id":"pkg-store@0.2.2","_shasum":"b1f5c0f8620a59fd66586acc5e256f4c2c37a0d8","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.5.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"b1f5c0f8620a59fd66586acc5e256f4c2c37a0d8","size":3673,"noattachment":false,"key":"/pkg-store/-/pkg-store-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-store/download/pkg-store-0.2.2.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/pkg-store-0.2.2.tgz_1460529609249_0.6713173394091427"},"directories":{},"publish_time":1460529610916,"_cnpm_publish_time":1460529610916,"_hasShrinkwrap":false},"0.2.1":{"name":"pkg-store","description":"Use package.json as a config store.","version":"0.2.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","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"cache-base":"^0.8.2","kind-of":"^3.0.2","lazy-cache":"^1.0.3","union-value":"^0.2.3","write-json":"^0.2.2"},"devDependencies":{"delete":"^0.3.0","gulp-format-md":"^0.1.7","mocha":"^2.4.5"},"keywords":["config","data","get","json","package","package.json","package-json","pkg","set","store","update"],"verb":{"run":true,"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["data-store","find-pkg","expand-pkg","normalize-pkg"]},"reflinks":["verb","cache-base"],"lint":{"reflinks":true}},"gitHead":"1b6591d71187ea6bf2da7dc8b973a3910956fbb7","_id":"pkg-store@0.2.1","_shasum":"186768df6ae47451cdb603416827e036e3aebde3","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.5.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"186768df6ae47451cdb603416827e036e3aebde3","size":3667,"noattachment":false,"key":"/pkg-store/-/pkg-store-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-store/download/pkg-store-0.2.1.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/pkg-store-0.2.1.tgz_1459447188343_0.07031941716559231"},"directories":{},"publish_time":1459447189327,"_cnpm_publish_time":1459447189327,"_hasShrinkwrap":false},"0.2.0":{"name":"pkg-store","description":"Use package.json as a config store.","version":"0.2.0","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","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"cache-base":"^0.8.2","kind-of":"^3.0.2","lazy-cache":"^1.0.3","union-value":"^0.2.3","write-json":"^0.2.2"},"devDependencies":{"delete":"^0.3.0","gulp-format-md":"^0.1.7","mocha":"^2.4.5"},"keywords":["config","data","get","json","package","package.json","package-json","pkg","set","store","update"],"verb":{"run":true,"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["data-store","find-pkg","expand-pkg","normalize-pkg"]},"reflinks":["verb","cache-base"],"lint":{"reflinks":true}},"gitHead":"c9251a4aee5698aee0c7e9342867602801c2b892","_id":"pkg-store@0.2.0","_shasum":"eb9d5472b6964ccd2329d3aabe9d0056d4bf0b81","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.5.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"eb9d5472b6964ccd2329d3aabe9d0056d4bf0b81","size":3607,"noattachment":false,"key":"/pkg-store/-/pkg-store-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-store/download/pkg-store-0.2.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pkg-store-0.2.0.tgz_1459390087211_0.24327236623503268"},"directories":{},"publish_time":1459390089541,"_cnpm_publish_time":1459390089541,"_hasShrinkwrap":false},"0.1.2":{"name":"pkg-store","description":"Use package.json as a config store.","version":"0.1.2","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.14.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":"df3b6a1c274536c6f570104790655ec876b56ecd","_id":"pkg-store@0.1.2","_shasum":"e5cd24478daeadcb45689af2d09c03979786ab84","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.5.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"e5cd24478daeadcb45689af2d09c03979786ab84","size":2436,"noattachment":false,"key":"/pkg-store/-/pkg-store-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-store/download/pkg-store-0.1.2.tgz"},"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/pkg-store-0.1.2.tgz_1454570200972_0.6844276359770447"},"directories":{},"publish_time":1454570203603,"_cnpm_publish_time":1454570203603,"_hasShrinkwrap":false},"0.1.1":{"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","size":2432,"noattachment":false,"key":"/pkg-store/-/pkg-store-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-store/download/pkg-store-0.1.1.tgz"},"directories":{},"publish_time":1453540570919,"_cnpm_publish_time":1453540570919,"_hasShrinkwrap":false},"0.1.0":{"name":"pkg-store","description":"Use package.json as a config store.","version":"0.1.0","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.12.0"},"devDependencies":{"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"]},"gitHead":"db9a78463be330b56e81dc97be82152e6a6a5aa5","_id":"pkg-store@0.1.0","_shasum":"616c91ef7e92f4a4860a272c9b08264fa2c6c6d7","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"616c91ef7e92f4a4860a272c9b08264fa2c6c6d7","size":2393,"noattachment":false,"key":"/pkg-store/-/pkg-store-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pkg-store/download/pkg-store-0.1.0.tgz"},"directories":{},"publish_time":1450832229617,"_cnpm_publish_time":1450832229617,"_hasShrinkwrap":false}},"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._","_attachments":{},"homepage":"https://github.com/jonschlinkert/pkg-store","bugs":{"url":"https://github.com/jonschlinkert/pkg-store/issues"},"license":"MIT"}