{"_id":"persistent-cache","_rev":"13-83712ee5645274aa04cb3ba425e6f81d","name":"persistent-cache","description":"A simple module to persistently store/cache arbitrary data.","dist-tags":{"latest":"1.1.2"},"versions":{"0.1.0":{"name":"persistent-cache","version":"0.1.0","description":"A simple module to persistently store/cache arbitrary data.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/lionc/persistent-cache.git"},"keywords":["cache","persistent","data","storage","store"],"author":{"name":"Leon Strauss","email":"me@lionc.de","url":"lionc.de"},"license":"MIT","bugs":{"url":"https://github.com/LionC/persistent-cache/issues"},"homepage":"https://github.com/LionC/persistent-cache#readme","dependencies":{"mkdirp-no-bin":"^0.5.1"},"gitHead":"ffc0228d2910160507566488ee3c74f5f99db87e","_id":"persistent-cache@0.1.0","scripts":{},"_shasum":"7310c480bf417890990ae689a7ebbb3419fb0fae","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"lionc","email":"me@lionc.de"},"dist":{"shasum":"7310c480bf417890990ae689a7ebbb3419fb0fae","tarball":"https://registry.npmjs.org/persistent-cache/-/persistent-cache-0.1.0.tgz","integrity":"sha512-AL8s0Z1cfawgM3Hn7eGixsLetxSTf/E4UUipRAaenQRoP9WVIenVzON7I6KnyHmtwP0Xd5ax4EfaIlhrVTO3UA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDzjnM03eRtcf5m+Zqw51JKBCWjVlN65nIvbcvHWZET0AiAsTC/l15S8c9Xc4Nl80TPhXTnhX0GjSGud07PtxKcJdQ=="}]},"maintainers":[{"name":"lionc","email":"me@lionc.de"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/persistent-cache-0.1.0.tgz_1464961201073_0.026244299951940775"},"directories":{}},"1.0.0":{"name":"persistent-cache","version":"1.0.0","description":"A simple module to persistently store/cache arbitrary data.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/lionc/persistent-cache.git"},"scripts":{"test":"mocha"},"keywords":["cache","persistent","data","storage","store"],"author":{"name":"Leon Strauss","email":"me@lionc.de","url":"lionc.de"},"license":"MIT","bugs":{"url":"https://github.com/LionC/persistent-cache/issues"},"homepage":"https://github.com/LionC/persistent-cache#readme","dependencies":{"mkdirp-no-bin":"^0.5.1","rmdir":"^1.2.0"},"devDependencies":{"mocha":"^2.5.3","should":"^9.0.2"},"gitHead":"fdf813a7ecf6caab5adfa302b8ae211197926ad7","_id":"persistent-cache@1.0.0","_shasum":"5d78503f67d21e0f37a30bda2b17803743ac0d68","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"lionc","email":"me@lionc.de"},"dist":{"shasum":"5d78503f67d21e0f37a30bda2b17803743ac0d68","tarball":"https://registry.npmjs.org/persistent-cache/-/persistent-cache-1.0.0.tgz","integrity":"sha512-BxndstL6zRZtmYx2APYZWtYlU3oaoKqynMoW/RZjcFx7vvNsNoaw8rNNWmgwbsl+RqDikpUEd1VPpDjTpz5ZNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAODb/cMGHISw2gVlOaam+Fa9vAk8RcfI0Og13+PG8XUAiBwC2fizVESlSk5UkrYTnIFmbTadgIaYMUWhejYheCMEQ=="}]},"maintainers":[{"name":"lionc","email":"me@lionc.de"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/persistent-cache-1.0.0.tgz_1465664085721_0.3160241721197963"},"directories":{}},"1.0.1":{"name":"persistent-cache","version":"1.0.1","description":"A simple module to persistently store/cache arbitrary data.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/lionc/persistent-cache.git"},"scripts":{"test":"mocha"},"keywords":["cache","persistent","data","storage","store"],"author":{"name":"Leon Strauss","email":"me@lionc.de","url":"lionc.de"},"license":"MIT","bugs":{"url":"https://github.com/LionC/persistent-cache/issues"},"homepage":"https://github.com/LionC/persistent-cache#readme","dependencies":{"mkdirp-no-bin":"^0.5.1","rmdir":"^1.2.0"},"devDependencies":{"mocha":"^2.5.3","should":"^9.0.2"},"gitHead":"125b3fe441daa1ece6c3f8e0c1e56d1bd97fbee9","_id":"persistent-cache@1.0.1","_shasum":"aed03e594da6edb54e8f96e6204d7a2ef6c16dd0","_from":".","_npmVersion":"3.10.6","_nodeVersion":"6.4.0","_npmUser":{"name":"lionc","email":"me@lionc.de"},"dist":{"shasum":"aed03e594da6edb54e8f96e6204d7a2ef6c16dd0","tarball":"https://registry.npmjs.org/persistent-cache/-/persistent-cache-1.0.1.tgz","integrity":"sha512-W1OGvvX2DgHvbYDSG26eYuSwsKtk7K6lHLqzYvzUmiU1EPLKySCXOEOU7K70QWD3vHueUVGHg1ZfrncaY8lhqw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDa4uJcvPO1i3o/ddbcrp+bn9+TEcLqzSE63tSJ9VUeEwIgOTfIOEfolPuP7iDc8JenizzuKNJgNpg6CN9hfCUi6dA="}]},"maintainers":[{"name":"lionc","email":"me@lionc.de"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/persistent-cache-1.0.1.tgz_1476533509948_0.7016572046559304"},"directories":{}},"1.0.2":{"name":"persistent-cache","version":"1.0.2","description":"A simple module to persistently store/cache arbitrary data.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/lionc/persistent-cache.git"},"scripts":{"test":"mocha"},"keywords":["cache","persistent","data","storage","store"],"author":{"name":"Leon Strauss","email":"me@lionc.de","url":"lionc.de"},"license":"MIT","bugs":{"url":"https://github.com/LionC/persistent-cache/issues"},"homepage":"https://github.com/LionC/persistent-cache#readme","dependencies":{"mkdirp-no-bin":"^0.5.1","rmdir":"^1.2.0"},"devDependencies":{"mocha":"^2.5.3","should":"^9.0.2"},"gitHead":"cb84df5426aee7df16e7fe7629d7310f103e4359","_id":"persistent-cache@1.0.2","_shasum":"37b6e65a8b3443951200fee384bd5ff0b0ade427","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.4.0","_npmUser":{"name":"lionc","email":"me@lionc.de"},"dist":{"shasum":"37b6e65a8b3443951200fee384bd5ff0b0ade427","tarball":"https://registry.npmjs.org/persistent-cache/-/persistent-cache-1.0.2.tgz","integrity":"sha512-8Rv2+OwNXziVWveZ+qtrktw6T5aFyovqyq3ibBLFQTRvpxZuVSXebYwZx8+G7H3AutVzOsc8vFR6twRSeK3p3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICHZ0edfR9MMsATMpgz77FNv0cWLdCk4wv1cDXUUfIMKAiEAnXyQf1cwOL7f9+BXNcyzx4cJwchBD1XcWozz7zGol6I="}]},"maintainers":[{"name":"lionc","email":"me@lionc.de"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/persistent-cache-1.0.2.tgz_1479418203560_0.8665400559548289"},"directories":{}},"1.0.3":{"name":"persistent-cache","version":"1.0.3","description":"A simple module to persistently store/cache arbitrary data.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/lionc/persistent-cache.git"},"scripts":{"test":"mocha"},"keywords":["cache","persistent","data","storage","store"],"author":{"name":"Leon Strauss","email":"me@lionc.de","url":"lionc.de"},"license":"MIT","bugs":{"url":"https://github.com/LionC/persistent-cache/issues"},"homepage":"https://github.com/LionC/persistent-cache#readme","dependencies":{"mkdirp-no-bin":"^0.5.1","rmdir":"^1.2.0"},"devDependencies":{"mocha":"^2.5.3","should":"^9.0.2"},"gitHead":"a85ec57bb8d8b36990bc82b8abfc2e85984d017a","_id":"persistent-cache@1.0.3","_shasum":"85955b807f27b2b3dd771defa84bf8b05b3bd5a2","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.4.0","_npmUser":{"name":"lionc","email":"me@lionc.de"},"dist":{"shasum":"85955b807f27b2b3dd771defa84bf8b05b3bd5a2","tarball":"https://registry.npmjs.org/persistent-cache/-/persistent-cache-1.0.3.tgz","integrity":"sha512-c1h1p2/a5V/FX248KhDlNeqhllxZgCk/IA/sYInCWtv1ZXKvkZPMTKSKukX4EbFaJtTs4vV1Y5PX6MbuxtEZjA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJIOuipRTXBZOQayIYIffq8Fsad5r3rcu8qZxybn09EAiEA0551FPZS3c+lr/LUTWkqT4SN9ULGbQSrMPxYmtc4dJM="}]},"maintainers":[{"name":"lionc","email":"me@lionc.de"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/persistent-cache-1.0.3.tgz_1479480227761_0.027293495135381818"},"directories":{}},"1.1.0":{"name":"persistent-cache","version":"1.1.0","description":"A simple module to persistently store/cache arbitrary data.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/lionc/persistent-cache.git"},"scripts":{"test":"mocha"},"keywords":["cache","persistent","data","storage","store"],"author":{"name":"Leon Strauss","email":"me@lionc.de","url":"lionc.de"},"license":"MIT","bugs":{"url":"https://github.com/LionC/persistent-cache/issues"},"homepage":"https://github.com/LionC/persistent-cache#readme","dependencies":{"mkdirp-no-bin":"^0.5.1","rmdir":"^1.2.0"},"devDependencies":{"mocha":"^2.5.3","should":"^9.0.2"},"gitHead":"9942b93aabea68defeb40e5a97ed5d7ca660acbc","_id":"persistent-cache@1.1.0","_shasum":"79ef3d3ad749c235d0ce813cd960ad225f3441dd","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.4.0","_npmUser":{"name":"lionc","email":"me@lionc.de"},"dist":{"shasum":"79ef3d3ad749c235d0ce813cd960ad225f3441dd","tarball":"https://registry.npmjs.org/persistent-cache/-/persistent-cache-1.1.0.tgz","integrity":"sha512-uIIZCQVCFFtEYBq+DNP25H6UBmS3f5+HM8oOQk3614FIPUj8ak/LT72TIcn4+hAFz7Tj3GzmDh86Yj+RwfbeZw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF/RDicEeijGHD4iyhUaz4kQF1UndTF8ZVGSgu0U+2mUAiEA0FKYBSEALefL3dDkhy0dtpBM4VmQS62WI/+Jh+nZNwc="}]},"maintainers":[{"name":"lionc","email":"me@lionc.de"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/persistent-cache-1.1.0.tgz_1479480929212_0.884652393637225"},"directories":{}},"1.1.1":{"name":"persistent-cache","version":"1.1.1","description":"A simple module to persistently store/cache arbitrary data.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/lionc/persistent-cache.git"},"scripts":{"test":"mocha"},"keywords":["cache","persistent","data","storage","store"],"author":{"name":"Leon Strauss","email":"me@lionc.de","url":"lionc.de"},"license":"MIT","bugs":{"url":"https://github.com/LionC/persistent-cache/issues"},"homepage":"https://github.com/LionC/persistent-cache#readme","dependencies":{"mkdirp-no-bin":"^0.5.1","rmdir":"^1.2.0"},"devDependencies":{"mocha":"^2.5.3","should":"^9.0.2"},"gitHead":"9ed57700f31871605c9b7cc99c7a49721a63a365","_id":"persistent-cache@1.1.1","_shasum":"9dd8813e085c4aba30987b08e11a9ca86a62a54c","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.4.0","_npmUser":{"name":"lionc","email":"me@lionc.de"},"dist":{"shasum":"9dd8813e085c4aba30987b08e11a9ca86a62a54c","tarball":"https://registry.npmjs.org/persistent-cache/-/persistent-cache-1.1.1.tgz","integrity":"sha512-wBvKDeO9zFoef+OLejoKtEUx8bPJCp8mbBOG1IRRGIx4i6hK3N6kh7kR2O0eGyEhDWZXiicvzCbvEUYhdTS9pQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICRkOJmFqaZQ8Q2xKzsj5L0yx9qL6ygdDdcxLAHYIeSoAiAM2gLCKDd56zavTAHfob1+kY9vql08auwCbP8KC9ieHw=="}]},"maintainers":[{"name":"lionc","email":"me@lionc.de"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/persistent-cache-1.1.1.tgz_1480065684108_0.09574117604643106"},"directories":{}},"1.1.2":{"name":"persistent-cache","version":"1.1.2","description":"A simple module to persistently store/cache arbitrary data.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/LionC/persistent-cache.git"},"scripts":{"test":"mocha"},"keywords":["cache","persistent","data","storage","store"],"author":{"name":"Leon Strauss","email":"me@lionc.de","url":"lionc.de"},"license":"MIT","bugs":{"url":"https://github.com/LionC/persistent-cache/issues"},"homepage":"https://github.com/LionC/persistent-cache#readme","dependencies":{"mkdirp-no-bin":"^0.5.1","rmdir":"^1.2.0"},"devDependencies":{"mocha":"^2.5.3","should":"^9.0.2"},"gitHead":"cb6218d49917a509b1c7af803ae61c12ed685228","_id":"persistent-cache@1.1.2","_nodeVersion":"14.15.3","_npmVersion":"8.1.0","dist":{"integrity":"sha512-kLyEWXf3hYDv4+NHclSCnjflEGqJMVdVDurNp25zuj9uI3BpkSvRSFtiXu2X9gyh+WkjcGVgcumoR06waIbF4g==","shasum":"59b7c7658a94d038807a626984256155bc66d544","tarball":"https://registry.npmjs.org/persistent-cache/-/persistent-cache-1.1.2.tgz","fileCount":4,"unpackedSize":14448,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlRaYCRA9TVsSAnZWagAAKMkP+wbBK7VeFC+hrr8qS5Nd\nQColF5hE9pdSNMZYPxII8Gkb2CyLooSCjmIb4tFAQQjvo71NRY5auwElyqtT\nyC8VT1R/DAWiAsBqVD4f+BJ5dRlWM7Unh79Zu/q4bDHK1ftP0uJ3re4Pdg8D\nNdmHoIPuT3IJ8n4+MQQhO1VvEqjYGirt43VaiTQzZk2NKgBDgb8WDZG2gzc+\nIM1mEgx/JlBi87Z0lix0xj+L8Ah5hT2bM3kRkUnI/byebgTeTOfD8BXx/1HZ\nk6dn3ubNmnrJAdydyPkLxysCcBf1tLnrE2JweJ2bwCmwiilarz0BL1+LeI3v\nuXT1mI4qPmBJKXnNbOLQJY29bsBXhV6K0uzVPDCqFOuotTjlek39mZVVSkwF\nlvZTSPE+XBNiaHi59aa+AsT/iI+nn2qf+8NnnDGW6o7Ft679hDUYh1IL98Jo\nRRBJdOrfZmEFeNzExA5ibs1GmKDMx0BGLzJfZZs6d1bIE//xFaZBo25Tdluc\nrbxrjVt/TKJUSbbqY1UoFuRfujm3Sk3f0o64VGVfzlQUmLT0JJaMfzdopyOy\niF9Z08NctPCPPDtMfhoNy/UTMIRYYMTxjWlt5QQRgvYNOqb6ksQNOVWXsSLa\nvpmaGeoqM21gKdnAsnFfLWSK7PJ7yXCEYOSpMVBLyGdQHMUDox0g52I6N5UK\ncAwu\r\n=9SlZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpupTE+tlmGxgVC0a11KozCt9eSUl9tgAhbf0L71bT7AIhAJAmI3SmEUyrkuhZZKcTQN5MCfZSepdAXoz1VDMzrBsp"}]},"_npmUser":{"name":"lionc","email":"me@lionc.de"},"directories":{},"maintainers":[{"name":"lionc","email":"me@lionc.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/persistent-cache_1.1.2_1637160600028_0.9978838488366852"},"_hasShrinkwrap":false}},"readme":"# persistent-cache\n\nA simple Node module to persistently store/cache arbitrary data.\n\n## How to install\n\nJust run\n\n```shel\nnpm install persistent-cache\n```\n\nadd the `--save` option to add `persistent-cache` to the `dependencies` in your `package.json`\n\n## Usage\n\n### Create cache\n\n```js\nvar cache = require('persistent-cache');\n\nvar cats = cache();\n```\n\n`cats` is now a cache with the default options, meaning it is a persistent\ncache utilizing memory caching for performance, it has the name `cache`, caches\ndata forever and is located in the `cache`-directory of the current main module.\nFor all available options, see the bottom of this page.\n\nAn empty cache of cats is kind of sad. Let's bring some life to it.\n\n### Insert data\n\n```js\n//Asynchronous\ncats.put('Cindy', {color: 'red'}, someCallback);\n\n//Synchronous\ncats.putSync('babies', ['Ron', 'Emily']);\n```\n\nNow our `cats`-cache has an entry `Cindy` containing an object `{color: 'red'}` and an entry `babies` containing an array of some names (strings).\n\n`cache.put(key, data, cb)` will store any arbitrary `data` in the cache under the provided `key` and call the provided callback when done (passing err as the first argument, following node convention). `cache.putSync(key, data)` is the synchronous counterpart (`throw`ing possible errors).\n\nIf there is already an entry for the provided key, `cache.put` will overwrite it.\n\nArgh, my dog quit the program. I miss my cats :-( Lets retrieve them from the cache.\n\n### Retrieve data\n\n```js\ncats.get('babies', function(err, babies) {\n    //check err for errors\n\n    console.log(babies); //['Ron', 'Emily']\n});\n\nconsole.log(cats.getSync('Cindy')); //{ color: 'red' }\n```\n\nThere they are :D\n\n`cache.get(key, cb)` will get the data saved under `key` from the cache and call the provided callback when done, passing the retrieved data as the second argument (again, passing error first following node convention). `cache.getSync` is the synchronous counterpart, returning the data. If there is no (valid) cache entry for the provided `key`, `undefined` will be returned/passed.\n\n## Getting available keys\n\nI forgot which cats I put in my cache. Fortunately I can look it up:\n\n```js\ncats.keys(function(err, keys) {\n    //Handle errors\n\n    console.log(keys); //['Cindy', 'babies']\n});\n\nconsole.log(cats.keysSync()); //['Cindy', 'babies']\n```\n\n`keys` (and its synchronous counterpart `keysSync`) finds all available keys in a cache.\n\nI found a new owner for my cute cat babies. So I need to remove them from my cache.\n\n### Delete data\n\n```js\ncats.delete('babies', function(err) {\n    //Handle errors\n\n    console.log('babies removed from cache');\n});\n```\n\nI safely removed my cat babies from the cache. Yey!\n\n`cache.delete(key, cb)` will remove the provided `key` from the cache and call the provided callback when done. `cache.deleteSync` is the synchronous counterpart.\n\n## Tidying up\n\nIf you want to delete the folder and files of a persistent cache, simply call `unlink` on it:\n\n```js\ncache.unlink(function(err) {\n    //The cache folder and files are gone now\n})\n```\n\nA persistent cache will obviously not work anymore after `unlink`ing it.\n\n## Options\n\n```js\nvar someCache = cache({\n    base: 'some/folder',\n    name: 'foo',\n    duration: 1000 * 3600 * 24 //one day\n});\n```\n\nWhen creating a new cache, you may pass an options object, with the following available properties:\n\n### `options.base`\n\nThe base directory where `persistent-cache` will save its caches.\n\nDefaults to the main modules directory\n\n### `options.name`\n\nThe name of the cache. Determines the name of the created folder where the data is stored, which is just `base + name`.\n\nDefaults to `cache`\n\n### `options.duration`\n\nThe amount of milliseconds a cache entry should be valid for. If not set, cache entries are not invalidated (stay until deleted).\n\nDefaults to `undefined` (infinite)\n\n### `options.memory`\n\nWhether the cache should use memory caching or not (mirrors all cache data in the ram,\nsaving disk I/O and increasing performance).\n\nDefaults to `true`\n\n### `options.persist`\n\nWhether the cache should be persistent, aka if it should write its data to the disk\nfor later use or not. Set this to `false` to create a memory-only cache.\n\nDefaults to `true`\n","maintainers":[{"name":"lionc","email":"me@lionc.de"}],"time":{"modified":"2022-06-23T18:55:06.293Z","created":"2016-06-03T13:40:03.439Z","0.1.0":"2016-06-03T13:40:03.439Z","1.0.0":"2016-06-11T16:54:48.404Z","1.0.1":"2016-10-15T12:11:51.652Z","1.0.2":"2016-11-17T21:30:05.242Z","1.0.3":"2016-11-18T14:43:49.908Z","1.1.0":"2016-11-18T14:55:29.718Z","1.1.1":"2016-11-25T09:21:25.996Z","1.1.2":"2021-11-17T14:50:00.172Z"},"homepage":"https://github.com/LionC/persistent-cache#readme","keywords":["cache","persistent","data","storage","store"],"repository":{"type":"git","url":"git+https://github.com/LionC/persistent-cache.git"},"author":{"name":"Leon Strauss","email":"me@lionc.de","url":"lionc.de"},"bugs":{"url":"https://github.com/LionC/persistent-cache/issues"},"license":"MIT","readmeFilename":"README.md","users":{"axelrindle":true,"bouchezb":true}}