{"_id":"n-cache","_rev":"4-332c94ef403728c47aadcec5b7890ca0","name":"n-cache","description":"NodeJS internal in memory cache.","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"n-cache","version":"0.0.1","description":"NodeJS internal in memory cache.","main":"index.js","scripts":{"test":"mocha node-cache-test.js"},"repository":{"type":"git","url":"https://github.com/khowarizmi/node-cache.git"},"keywords":["cache","caching","local","multi","memory","internal","node","memcached"],"author":{"name":"khowarizmi"},"license":"MIT","bugs":{"url":"https://github.com/khowarizmi/node-cache/issues"},"homepage":"https://github.com/khowarizmi/node-cache","dependencies":{"lodash":"*"},"devDependencies":{"mocha":"*","assert":"*"},"gitHead":"221cf3704ead882cdae5fb3b822a490aaa66eb51","_id":"n-cache@0.0.1","_shasum":"03c6b9ab36538282f658d3d3886f3c5973486c46","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"khowarizmi","email":"alkhowarizmi169@gmail.com"},"maintainers":[{"name":"khowarizmi","email":"alkhowarizmi169@gmail.com"}],"dist":{"shasum":"03c6b9ab36538282f658d3d3886f3c5973486c46","tarball":"https://registry.npmjs.org/n-cache/-/n-cache-0.0.1.tgz","integrity":"sha512-uFcJ1PVQmxGIX6SWPRQ5PGH2sdYUpDBEBhuNx9g4Jhy8OKqxTAZwLKb0mFnC5cnLn3AVknqgfjh7nCjOAPUO2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICUp70yXJQcB4Ery+g06AQkdQ+KXLBS56zOn+u9aM8VfAiAY7yDdP/mhGu3qRJdx0FEovdIC1piRFXy+bEkBL8Fupw=="}]}}},"readme":"node-cache\n==========\n\nNodeJS internal in memory cache.\n\n\n#Install\n---\n\n#Usage\n---\n```\nvar NodeCache = require('n-cache'),\n\tcache = new NodeCache();\n\n// in usual\ncache.set('foo', 'bar');\nconsole.log(cache.get('foo'))\n\n// in particular\ncache.set('Alien', 'exist', 1); // Time in second\n\nconsole.log(cache.get('Alien'));\n\nsetTimeout(function() {\n    console.log(cache.get('Alien'));\n}, 1500);\n```\n\n\n#API\n---\n### new NodeCache([options])\n```\n{\n\tttl: 0 // Time of key expired, 0 stand for live for ever\n\ttimeMultiplier: 1000 // Times on ttl, makes 1ttl for 1 second\n\tcheckperiod: 600 // The period in seconds, check the expired data\n}\n```\n\n\n### set(key, value, [ttl])\n\n- Set a key value pair.\n- It will be del after ttl seconds, unless ttl not passed in.\n- Return true.\n\n### get(key)\n- Get a setted key.\n- Return value.\n\n### del(key)\n- Del a setted key.\n- Return 1, if key exist and not expired.\n\n### flushall()\n- Remove all data\n\n### ttl(key, ttl)\n- Reset the expire time for a exit key.\n\n### keys()\n- Return all the stored keys\n\n### mset([{key: key1, value: value1, [ttl: ttl1]}...])\n\n### mget([key1, key2...])\n\n### mdel([key1, key2...])\n\n\n\n\n\n\n","maintainers":[{"name":"khowarizmi","email":"alkhowarizmi169@gmail.com"}],"time":{"modified":"2022-06-20T18:49:55.189Z","created":"2014-12-25T16:43:33.870Z","0.0.1":"2014-12-25T16:43:33.870Z"},"homepage":"https://github.com/khowarizmi/node-cache","keywords":["cache","caching","local","multi","memory","internal","node","memcached"],"repository":{"type":"git","url":"https://github.com/khowarizmi/node-cache.git"},"author":{"name":"khowarizmi"},"bugs":{"url":"https://github.com/khowarizmi/node-cache/issues"},"license":"MIT","readmeFilename":"README.md"}