{"_id":"fs-memory-store","_rev":"8-75090a3caee66f6897d05f4399e0676d","name":"fs-memory-store","description":"Filesystem store with in-memory cache","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"fs-memory-store","description":"Filesystem store with in-memory cache","version":"0.1.0","homepage":"https://github.com/twolfson/fs-memory-store","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/fs-memory-store.git"},"bugs":{"url":"https://github.com/twolfson/fs-memory-store/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/fs-memory-store/blob/master/LICENSE-MIT"}],"main":"lib/fs-memory-store","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha"},"dependencies":{"clone":"~0.1.11","mkdirp":"~0.3.5"},"devDependencies":{"mocha":"~1.11.0","grunt":"~0.4.1","grunt-contrib-jshint":"~0.6.0","grunt-contrib-watch":"~0.4.0","mocha-fixture-dir":"~0.1.0","fixture-dir":"~0.1.0","chai":"~1.9.1","obj-extend":"~0.1.0"},"keywords":["fs","memory","store","cache","filesystem","disk"],"_id":"fs-memory-store@0.1.0","dist":{"shasum":"50ef0aae11846e9a2939bd50cabbc2b5c3ce2c7f","tarball":"https://registry.npmjs.org/fs-memory-store/-/fs-memory-store-0.1.0.tgz","integrity":"sha512-DV4ucf9LMei3UkIg4CXBx0QLNxH5+FWU5wIs8ouxbZ4m0PWr7kbF1qSLVveVdvNh24UFrnt+tjUGlciwFsqZow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8aLN8zYzBM1+z4Zw7rwhFWjs9zcfEf1luwvIQfVjqEgIgSTqHTQ1ZJn39FZ9hVNahziSh+BoBXLiFSpuG9leaags="}]},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}]},"0.1.1":{"name":"fs-memory-store","description":"Filesystem store with in-memory cache","version":"0.1.1","homepage":"https://github.com/twolfson/fs-memory-store","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/fs-memory-store.git"},"bugs":{"url":"https://github.com/twolfson/fs-memory-store/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/fs-memory-store/blob/master/LICENSE-MIT"}],"main":"lib/fs-memory-store","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha"},"dependencies":{"clone":"~0.1.11","mkdirp":"~0.3.5"},"devDependencies":{"mocha":"~1.11.0","grunt":"~0.4.1","grunt-contrib-jshint":"~0.6.0","grunt-contrib-watch":"~0.4.0","mocha-fixture-dir":"~0.1.0","fixture-dir":"~0.1.0","chai":"~1.9.1","obj-extend":"~0.1.0"},"keywords":["fs","memory","store","cache","filesystem","disk"],"gitHead":"5a5be33c2997738678379933ddfd8c2aee52159c","_id":"fs-memory-store@0.1.1","_shasum":"d0cc0238cba5f48b58df1cc6e2ddf5f9f151ee86","_from":".","_npmVersion":"2.3.0","_nodeVersion":"0.10.35","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"dist":{"shasum":"d0cc0238cba5f48b58df1cc6e2ddf5f9f151ee86","tarball":"https://registry.npmjs.org/fs-memory-store/-/fs-memory-store-0.1.1.tgz","integrity":"sha512-jxncDszed/D7bOhZsPWNPFQ7HuAGk5OGj2U/sRU3tu3Os/ShJxjiJHt4JN6yPievk3saeOEHJxGFxlbIASfxAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGN0lkmeDdjZrHTmSFyqXY+dSdyVOwPofAdPoX9mcbs4AiARXHS5wxb0KNQGmakA2R8Ik0C/jOblMYCN+F1D5dGobw=="}]}},"0.2.0":{"name":"fs-memory-store","description":"Filesystem store with in-memory cache","version":"0.2.0","homepage":"https://github.com/twolfson/fs-memory-store","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/fs-memory-store.git"},"bugs":{"url":"https://github.com/twolfson/fs-memory-store/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/fs-memory-store/blob/master/LICENSE-MIT"}],"main":"lib/fs-memory-store","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha"},"dependencies":{"clone":"~0.1.11","mkdirp":"~0.3.5"},"devDependencies":{"mocha":"~1.11.0","grunt":"~0.4.1","grunt-contrib-jshint":"~0.6.0","grunt-contrib-watch":"~0.4.0","mocha-fixture-dir":"~0.1.0","fixture-dir":"~0.1.0","chai":"~1.9.1","obj-extend":"~0.1.0"},"keywords":["fs","memory","store","cache","filesystem","disk"],"gitHead":"2f3b6e336097ec1d5f1a29c4ecbed70fbece1032","_id":"fs-memory-store@0.2.0","_shasum":"db4883fe912b0397e64e6b4017a1dd693eae8311","_from":".","_npmVersion":"2.3.0","_nodeVersion":"0.10.35","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"dist":{"shasum":"db4883fe912b0397e64e6b4017a1dd693eae8311","tarball":"https://registry.npmjs.org/fs-memory-store/-/fs-memory-store-0.2.0.tgz","integrity":"sha512-nXcOMXJXVrmDyFzd+4yLYXTq7E3wl+bb2ZuvKV0SUuTBb62IIw1kPoRwo9tcT5M3IwH6/5QT8k0kZTVFRY31ag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDO4FtfWokJV0+kSWkAFvAuFP1G9YpnCXyxZNyuhNcsHwIhAMBrG9eHPNUeTIjz9l8SH7GBNNRhL9Tysesu5V85OGua"}]}}},"readme":"# fs-memory-store [![Build status](https://travis-ci.org/twolfson/fs-memory-store.png?branch=master)](https://travis-ci.org/twolfson/fs-memory-store)\n\nFilesystem store with in-memory cache\n\nThis was built for usage with [`eight-track`][], an HTTP fixture library. It is designed for ease-of-access while debugging. By default, items will be stored to separate `.json` files in the folder.\n\n[`eight-track`]: https://github.com/uber/eight-track\n\n## Getting Started\nInstall the module with: `npm install fs-memory-store`\n\n```js\n// Generate a store inside of `http-fixtures`\nvar Store = require('fs-memory-store');\nvar store = new Store(__dirname + '/http-fixtures');\n\n// Save a value\nstore.set('hello', {world: true}, function (err) {\n  // If there was an error, `err` will be it\n\n  // We have created `http-fixtures/hello.json`\n  /*\n  {\n    \"world\": true\n  }\n  */\n\n  // Load the value\n  store.get('hello', function (err, val) {\n    // If there was an error, `err` will be it\n    // Log our value\n    console.log(val); /* {world: true} */\n  });\n\n  // Load an non-existent value\n  store.get('wat', function (err, val) {\n    // If there was an error, `err` will be it\n    // Log our value\n    console.log(val); /* null */\n  });\n});\n```\n\n## Documentation\n`fs-memory-store` returns `Store` as its `module.exports`.\n\n### `Store(dir, options)`\nConstructor for a new store\n\n- dir `String`, Directory to generate our store inside of\n- options `Object`, Container for options/flags\n    - ext `String`, Extension to save values under. By default, this is `.json`\n    - stringify `Function`, Stringifier to pass values through when saving to disk\n        - By default, this is `JSON.stringify` with an indenation of 2\n    - parse `Function`, Parser to pass values through when loading from disk\n        - By default, this is `JSON.parse`\n\n#### `Store#get(key, cb)`\nRetrieve an item from memory with a fallback to disk.\n\n- key `String`, Identifier to retrieve item by\n- cb `Function`, Error-first callback function to receive item value\n    - Signature should be `(err, val)`\n    - err `Error|null`, If there was an error, this will be it\n    - val `Mixed|null`, If the value was found, this will be it. If it was not found, this will be `null`.\n\n#### `Store#set(key, val, cb)`\nSave an item to memory and disk\n\n- key `String`, Identifier to save item under\n- val `Mixed`, Value to save under the `key`\n- cb `Function`, Error-first callback function to handle errors\n    - Signature should be `(err)`\n    - err `Error|null`, If there was an error, this will be it\n\n#### `Store#delete(key, cb)`\nDelete an item from memory and disk\n\n- key `String`, Identifier to delete item under\n- cb `Function`, Error-first callback function to handle errors\n    - Signature should be `(err)`\n    - err `Error|null`, If there was an error, this will be it\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint via [grunt](https://github.com/gruntjs/grunt) and test via `npm test`.\n\n## Donating\nSupport this project and [others by twolfson][gittip] via [gittip][].\n\n[![Support via Gittip][gittip-badge]][gittip]\n\n[gittip-badge]: https://rawgithub.com/twolfson/gittip-badge/master/dist/gittip.png\n[gittip]: https://www.gittip.com/twolfson/\n\n## License\nCopyright (c) 2014 Todd Wolfson\n\nLicensed under the MIT license.\n","maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"time":{"modified":"2022-06-18T03:54:00.841Z","created":"2014-04-13T22:34:36.858Z","0.1.0":"2014-04-13T22:34:36.858Z","0.1.1":"2015-02-09T06:53:15.388Z","0.2.0":"2015-02-09T06:56:31.884Z"},"homepage":"https://github.com/twolfson/fs-memory-store","keywords":["fs","memory","store","cache","filesystem","disk"],"repository":{"type":"git","url":"git://github.com/twolfson/fs-memory-store.git"},"author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"bugs":{"url":"https://github.com/twolfson/fs-memory-store/issues"},"readmeFilename":"README.md"}