{"_id":"plasma-cache","_rev":"75901","name":"plasma-cache","description":"Object cache for [Plasma].","dist-tags":{"latest":"0.2.2"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:24:33.000Z","created":"2015-05-30T08:52:58.761Z","0.2.2":"2015-06-01T08:03:12.204Z","0.2.1":"2015-06-01T07:58:05.596Z","0.2.0":"2015-06-01T06:03:53.875Z","0.1.2":"2015-06-01T04:27:21.611Z","0.1.1":"2015-05-30T08:58:59.687Z","0.1.0":"2015-05-30T08:52:58.761Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/plasma-cache.git"},"versions":{"0.2.2":{"name":"plasma-cache","description":"Object cache for [Plasma].","version":"0.2.2","homepage":"https://github.com/jonschlinkert/plasma-cache","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/plasma-cache.git"},"bugs":{"url":"https://github.com/jonschlinkert/plasma-cache/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"component-emitter":"^1.2.0","expander":"^0.3.3","extend-shallow":"^1.1.4","filter-functions":"^0.1.0","lazy-cache":"^0.1.0","object.omit":"^1.1.0","plasma":"^0.9.1"},"devDependencies":{"js-yaml":"^3.3.1","mocha":"*","should":"*"},"keywords":["cache","config","data","extend","file","fs","get","hash","json","object","read","set","storage","store","yaml"],"gitHead":"00e849091e95b5e22957422112a5c06d2f041cd0","_id":"plasma-cache@0.2.2","_shasum":"0ed7741c7ae57eaaa0ec573e93e94c6116a259e7","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"0ed7741c7ae57eaaa0ec573e93e94c6116a259e7","size":3945,"noattachment":false,"key":"/plasma-cache/-/plasma-cache-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/plasma-cache/download/plasma-cache-0.2.2.tgz"},"directories":{},"publish_time":1433145792204,"_cnpm_publish_time":1433145792204,"_hasShrinkwrap":false},"0.2.1":{"name":"plasma-cache","description":"Object cache for [Plasma].","version":"0.2.1","homepage":"https://github.com/jonschlinkert/plasma-cache","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/plasma-cache.git"},"bugs":{"url":"https://github.com/jonschlinkert/plasma-cache/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"component-emitter":"^1.2.0","expander":"^0.3.3","extend-shallow":"^1.1.4","filter-functions":"^0.1.0","lazy-cache":"^0.1.0","object.omit":"^1.1.0","plasma":"^0.9.1"},"devDependencies":{"js-yaml":"^3.3.1","mocha":"*","should":"*"},"keywords":["cache","config","data","extend","file","fs","get","hash","json","object","read","set","storage","store","yaml"],"gitHead":"147e6e8e6111a1a8ba3358e0e14dc3e888ffd55b","_id":"plasma-cache@0.2.1","_shasum":"5d3d8267bde873a5dae86361dab9706044d3b564","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"5d3d8267bde873a5dae86361dab9706044d3b564","size":3944,"noattachment":false,"key":"/plasma-cache/-/plasma-cache-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/plasma-cache/download/plasma-cache-0.2.1.tgz"},"directories":{},"publish_time":1433145485596,"_cnpm_publish_time":1433145485596,"_hasShrinkwrap":false},"0.2.0":{"name":"plasma-cache","description":"Object cache for [Plasma].","version":"0.2.0","homepage":"https://github.com/jonschlinkert/plasma-cache","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/plasma-cache.git"},"bugs":{"url":"https://github.com/jonschlinkert/plasma-cache/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"component-emitter":"^1.2.0","expander":"^0.3.3","extend-shallow":"^1.1.4","filter-functions":"^0.1.0","object.omit":"^1.1.0","plasma":"^0.9.0"},"devDependencies":{"js-yaml":"^3.3.1","mocha":"*","should":"*"},"keywords":["cache","config","data","extend","file","fs","get","hash","json","object","read","set","storage","store","yaml"],"gitHead":"7cd288e270c91cc187ccccb5c3bc87aba1bf5a96","_id":"plasma-cache@0.2.0","_shasum":"9d1c01d7017986158bd77f6d625ede3ecab8a2cb","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"9d1c01d7017986158bd77f6d625ede3ecab8a2cb","size":3893,"noattachment":false,"key":"/plasma-cache/-/plasma-cache-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/plasma-cache/download/plasma-cache-0.2.0.tgz"},"directories":{},"publish_time":1433138633875,"_cnpm_publish_time":1433138633875,"_hasShrinkwrap":false},"0.1.2":{"name":"plasma-cache","description":"Object cache for [Plasma].","version":"0.1.2","homepage":"https://github.com/jonschlinkert/plasma-cache","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/plasma-cache.git"},"bugs":{"url":"https://github.com/jonschlinkert/plasma-cache/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"component-emitter":"^1.2.0","expander":"^0.3.3","extend-shallow":"^1.1.4","filter-functions":"^0.1.0","object.omit":"^1.1.0","plasma":"^0.8.2"},"devDependencies":{"mocha":"*","should":"*"},"keywords":["cache","config","data","extend","file","fs","get","hash","json","object","read","set","storage","store","yaml"],"gitHead":"780a9d4f64ec48d5357920604d6d15d4782ac8e3","_id":"plasma-cache@0.1.2","_shasum":"528f04a863a0f90a2c82979d0ce40cbecdbbb8a3","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"528f04a863a0f90a2c82979d0ce40cbecdbbb8a3","size":3643,"noattachment":false,"key":"/plasma-cache/-/plasma-cache-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/plasma-cache/download/plasma-cache-0.1.2.tgz"},"directories":{},"publish_time":1433132841611,"_cnpm_publish_time":1433132841611,"_hasShrinkwrap":false},"0.1.1":{"name":"plasma-cache","description":"Object cache for Plasma.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/plasma-cache","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/plasma-cache"},"bugs":{"url":"https://github.com/jonschlinkert/plasma-cache/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"expander":"^0.3.3","extend-shallow":"^1.1.4","filter-functions":"^0.1.0","object.omit":"^1.1.0","plasma":"^0.8.2"},"devDependencies":{"mocha":"*","should":"*"},"keywords":["cache","config","data","extend","file","fs","get","hash","json","object","read","set","storage","store","yaml"],"gitHead":"cf2f6f3f7adf97dd5e87df5875cc246ee6c485f8","_id":"plasma-cache@0.1.1","_shasum":"ac85b5a351df277786602ad45ff5fc13d292c5a8","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"ac85b5a351df277786602ad45ff5fc13d292c5a8","size":3536,"noattachment":false,"key":"/plasma-cache/-/plasma-cache-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/plasma-cache/download/plasma-cache-0.1.1.tgz"},"directories":{},"publish_time":1432976339687,"_cnpm_publish_time":1432976339687,"_hasShrinkwrap":false},"0.1.0":{"name":"plasma-cache","description":"Object cache for plasma.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/plasma-cache","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/plasma-cache"},"bugs":{"url":"https://github.com/jonschlinkert/plasma-cache/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"expander":"^0.3.3","extend-shallow":"^1.1.4","filter-functions":"^0.1.0","kind-of":"^1.1.0","object.omit":"^1.1.0","plasma":"^0.8.2"},"devDependencies":{"mocha":"*","should":"*"},"keywords":[],"_id":"plasma-cache@0.1.0","_shasum":"461b7078d3b35f06cc4a31bfd9f6ab96f99ba1b9","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"461b7078d3b35f06cc4a31bfd9f6ab96f99ba1b9","size":3456,"noattachment":false,"key":"/plasma-cache/-/plasma-cache-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/plasma-cache/download/plasma-cache-0.1.0.tgz"},"directories":{},"publish_time":1432975978761,"_cnpm_publish_time":1432975978761,"_hasShrinkwrap":false}},"readme":"# plasma-cache [![NPM version](https://badge.fury.io/js/plasma-cache.svg)](http://badge.fury.io/js/plasma-cache)\n\n> Object cache for [Plasma](https://github.com/jonschlinkert/plasma).\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i plasma-cache --save\n```\n\nInstall with [bower](http://bower.io/)\n\n```sh\n$ bower install plasma-cache --save\n```\n\n## Usage\n\n```js\nvar PlasmaCache = require('plasma-cache');\nvar cache = new PlasmaCache();\n```\n\n## API\n\n### [PlasmaCache](index.js#L23)\n\nInitialize a new `PlasmaCache`.\n\n### [.plasma](index.js#L58)\n\nExtend the `data` object with the value returned by [plasma](https://github.com/jonschlinkert/plasma).\n\nSee the [plasma](https://github.com/jonschlinkert/plasma) documentation for all available options.\n\n**Params**\n\n* `data` **{Object|String|Array}**: File path(s), glob pattern, or object of data.\n* `options` **{Object}**: Options to pass to plasma.\n\n**Example**\n\n```js\ncache\n  .plasma({foo: 'bar'}, {baz: 'quux'});\n  .plasma({fez: 'bang'});\n```\n\n### [.dataLoader](index.js#L82)\n\nRegister a `dataLoader` that will read and load data from files with the given `ext`.\n\n**Params**\n\n* `ext` **{String}**: The extension of files to read.\n* `fn` **{String}**: The loader function\n\n**Example**\n\n```js\nvar fs = require('fs');\nvar yaml = require('js-yaml');\n\nplasma.dataLoader('yml', function (fp) {\n  var str = fs.readFileSync(fp, 'utf8');\n  return yaml.safeLoad(str);\n});\n```\n\n### [.process](index.js#L96)\n\nUse [expander](https://github.com/tkellen/expander) to recursively expand template strings into\ntheir resolved values.\n\n**Params**\n\n* `lookup` **{*}**: Any value to process, usually strings with a cache template, like `<%= foo %>` or `${foo}`.\n* `opts` **{*}**: Options to pass to Lo-Dash `  _.template`.\n\n**Example**\n\n```js\ncache.process({a: '<%= b %>', b: 'c'});\n//=> {a: 'c', b: 'c'}\n```\n\n### [.flattenData](index.js#L122)\n\nIf a `data` property is on the given `data` object\n(e.g. `data.data`, like when files named `data.json`\nor `data.yml` are used), `data.data` is flattened to\njust `data`\n\n**Params**\n\n* `data` **{Object}**\n* `returns` **{Object}**: Flattened object.\n\n### [.extendData](index.js#L136)\n\nExtend the `cache.data` object with the given data. This\nmethod is chainable.\n\n* `returns` **{Object}** `PlasmaCache`: to enable chaining\n\n**Example**\n\n```js\ncache\n  .extendData({foo: 'bar'}, {baz: 'quux'});\n  .extendData({fez: 'bang'});\n```\n\n### [.data](index.js#L165)\n\nExtend the `cache.data` object with data from a JSON\nor YAML file, or by passing an object directly - glob\npatterns or file paths may be used.\n\n**Params**\n* `values` **{Object|Array|String}**: Values to pass to plasma.\n* `process` **{Boolean}**: If `true` is passed as the last argumemnt data will\n* `returns` **{Object}** `PlasmaCache`: to enable chaining\n\n**Example**\n\n```js\ncache\n  .data({a: 'b'})\n  .data({c: 'd'});\n\nconsole.log(cache);\n//=> {data: {a: 'b', c: 'd'}}\n\ncache.data('*.{json,yml}');\n// or\ncache.data('package.json');\n//=> {name: 'plasma-cache', ...}\n\n// process config templates\ncache.data({a: '<%= b %>', b: 'z'})\n//=> {data: {a: 'z', b: 'z'}}\n```\n\n## Related projects\n\n* [config-cache](https://github.com/jonschlinkert/config-cache): General purpose JavaScript object storage methods.\n* [data-store](https://github.com/jonschlinkert/data-store): Easily get, set and persist config data.\n* [option-cache](https://github.com/jonschlinkert/option-cache): Simple API for managing options in JavaScript applications.\n* [plasma](https://github.com/jonschlinkert/plasma): Load data from globs or files or directly from objects.\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d && npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/plasma-cache/issues/new)\n\n## Author\n\n**Jon Schlinkert**\n\n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 01, 2015._\n","_attachments":{},"homepage":"https://github.com/jonschlinkert/plasma-cache","bugs":{"url":"https://github.com/jonschlinkert/plasma-cache/issues"},"license":"MIT"}