{"_id":"memored","_rev":"18-11fe1df604157b643d27f32d87d9eb80","name":"memored","description":"Shared in-memory module for cluster applications","dist-tags":{"latest":"1.1.1"},"versions":{"0.0.1":{"name":"memored","version":"0.0.1","description":"Shared in-memory module for cluster applications","main":"index.js","scripts":{"test":"gulp"},"author":{"name":"Paquitosoft"},"license":"MIT","devDependencies":{"async":"^0.9.0","chai":"^1.9.1","faker":"^1.1.0","gulp":"^3.8.7","gulp-mocha":"^1.0.0"},"gitHead":"de94b647db4d962046c5dc45b1b425cc2d25fd66","_id":"memored@0.0.1","_shasum":"440a6a0b617747af33b963ca7b8174af22ba8f81","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"paquitosoft","email":"paquitosoftware@gmail.com"},"maintainers":[{"name":"paquitosoft","email":"paquitosoftware@gmail.com"}],"dist":{"shasum":"440a6a0b617747af33b963ca7b8174af22ba8f81","tarball":"https://registry.npmjs.org/memored/-/memored-0.0.1.tgz","integrity":"sha512-m1X46zk4D1OGGMsv2zZEHq2G63bR+4p7H4LMLkx3OIgk1Sad5Qb9/Wwa0DUQyz8pWlb3vdgdERp3ZLR5TTtHxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpz8ByM/X68O4MWL0k3EBBiCRXKvgXUbx0jg5c9xL01wIgGUxRneT9Vp+S27MHICd8SM36b7oyqudm/Yat7AuNZEE="}]},"directories":{}},"0.0.2":{"name":"memored","version":"0.0.2","description":"Shared in-memory module for cluster applications","main":"index.js","scripts":{"test":"gulp"},"author":{"name":"Paquitosoft"},"license":"MIT","keywords":["cache","memory","shared"],"devDependencies":{"async":"^0.9.0","chai":"^1.9.1","faker":"^1.1.0","gulp":"^3.8.7","gulp-mocha":"^1.0.0"},"gitHead":"5296b9f384e799fc7e94d7a90e1d3d1f615058ef","_id":"memored@0.0.2","_shasum":"20e0736109906060bf4f063b7bfdf88b87111d50","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"paquitosoft","email":"paquitosoftware@gmail.com"},"maintainers":[{"name":"paquitosoft","email":"paquitosoftware@gmail.com"}],"dist":{"shasum":"20e0736109906060bf4f063b7bfdf88b87111d50","tarball":"https://registry.npmjs.org/memored/-/memored-0.0.2.tgz","integrity":"sha512-J+QRxlydbPA79/7oNHR7zgtigoOQyJ/oXGRu4pPccq7cEuosQ3MeiPYihsIRA4+PVaQZ7cr2P3LhqcQlEtDg+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDaNnCZQxbBCThu2p/YKlbme6WATcQmsvbiUdwQg2lxEAiAjPawbCmgvOecocehjz0CsCXGg6ogNSbPqjxzlnCQl2Q=="}]},"directories":{}},"0.0.3":{"name":"memored","version":"0.0.3","description":"Shared in-memory module for cluster applications","main":"index.js","scripts":{"test":"gulp"},"author":{"name":"Paquitosoft"},"license":"MIT","keywords":["cache","memory","shared"],"repository":{"type":"git","url":"https://github.com/PaquitoSoft/memored.git"},"bugs":{"url":"https://github.com/PaquitoSoft/memored/issues"},"devDependencies":{"async":"^0.9.0","chai":"^1.9.1","faker":"^1.1.0","gulp":"^3.8.7","gulp-mocha":"^1.0.0"},"gitHead":"6d6568851410b6d9b3327df13f03c1062d4225b5","homepage":"https://github.com/PaquitoSoft/memored","_id":"memored@0.0.3","_shasum":"40d7fed7f4839b0688fa9d57915836ee659b77f9","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"paquitosoft","email":"paquitosoftware@gmail.com"},"maintainers":[{"name":"paquitosoft","email":"paquitosoftware@gmail.com"}],"dist":{"shasum":"40d7fed7f4839b0688fa9d57915836ee659b77f9","tarball":"https://registry.npmjs.org/memored/-/memored-0.0.3.tgz","integrity":"sha512-tF/VwInXSsCKy3uz4GMybFCsNGdlRtmEhm6ghAWGg1rEVqbTyj276ES9tpl/ziHVfH7tKUwAe01gOkDOdQmAaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrf0crWsOowAEIzH6NIb3zmhdiTGeIEHeSR+GMUmYkGgIgCwGKsXuyHTzWARVY21uJed6AP5AzHWjpk92R3TsIAtc="}]},"directories":{}},"0.0.4":{"name":"memored","version":"0.0.4","description":"Shared in-memory module for cluster applications","main":"index.js","scripts":{"test":"gulp"},"author":{"name":"Paquitosoft"},"license":"MIT","keywords":["cache","memory","shared"],"repository":{"type":"git","url":"https://github.com/PaquitoSoft/memored.git"},"bugs":{"url":"https://github.com/PaquitoSoft/memored/issues"},"devDependencies":{"async":"^0.9.0","chai":"^1.9.1","faker":"^1.1.0","gulp":"^3.8.7","gulp-mocha":"^1.0.0"},"gitHead":"37d1ab5e06ab4fc5d3ff99d36bf4be7cbe019567","homepage":"https://github.com/PaquitoSoft/memored","_id":"memored@0.0.4","_shasum":"70b21f1707cb28f04ea2ef9629109b75f8cf7791","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"paquitosoft","email":"paquitosoftware@gmail.com"},"maintainers":[{"name":"paquitosoft","email":"paquitosoftware@gmail.com"}],"dist":{"shasum":"70b21f1707cb28f04ea2ef9629109b75f8cf7791","tarball":"https://registry.npmjs.org/memored/-/memored-0.0.4.tgz","integrity":"sha512-Z2dxyDkAzR4mCrGALpvX63Du+4t3WExfKyPWkpu7pLI8UPte73qowsYK0CHAgcgIvEnasMOs+p8u6k8KhEGWNw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC7knojY6mmBoTYoTSA3P2546e+lsc72Sb0ojGvWQI6zAiB7Cp5ehL1rCVxGRNb9we60YZCIoWFWUn211G5L5QlF9A=="}]},"directories":{}},"0.1.0":{"name":"memored","version":"0.1.0","description":"Shared in-memory module for cluster applications","main":"index.js","scripts":{"test":"gulp"},"author":{"name":"Paquitosoft"},"license":"MIT","keywords":["cache","memory","shared"],"repository":{"type":"git","url":"https://github.com/PaquitoSoft/memored.git"},"bugs":{"url":"https://github.com/PaquitoSoft/memored/issues"},"devDependencies":{"async":"^0.9.0","chai":"^1.9.1","faker":"^1.1.0","gulp":"^3.8.7","gulp-mocha":"^1.0.0"},"gitHead":"2ebed97cec4d7142f8864d9e947e59cf6627bccc","homepage":"https://github.com/PaquitoSoft/memored","_id":"memored@0.1.0","_shasum":"7898bf1e9408a6c3e9afaf18482202a15563d679","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"paquitosoft","email":"paquitosoftware@gmail.com"},"maintainers":[{"name":"paquitosoft","email":"paquitosoftware@gmail.com"}],"dist":{"shasum":"7898bf1e9408a6c3e9afaf18482202a15563d679","tarball":"https://registry.npmjs.org/memored/-/memored-0.1.0.tgz","integrity":"sha512-Pxthn1zSyHWHuqpikgAMVpWqEcz6YMjqMJmfKQuXpg9759RpFG0sGJbIDX5HL0ecY6bqE4vh1rHyLj6ekGl0CA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBIlTOlohXaTYYq2kB0LI7PuPLKYAacc6+mwHb5N3C1LAiBEkClmYIaygweTNsRiGIf/ViTXXTmyzlz67Hh5Se97eQ=="}]},"directories":{}},"1.0.0":{"name":"memored","version":"1.0.0","description":"Shared in-memory module for cluster applications","main":"index.js","scripts":{"dev":"mocha --ui bdd --reporter spec --no-exit --watch ./spec","test":"mocha --ui bdd --reporter spec --no-exit ./spec"},"author":{"name":"Paquitosoft"},"license":"MIT","keywords":["cache","memory","shared"],"repository":{"type":"git","url":"git+https://github.com/PaquitoSoft/memored.git"},"bugs":{"url":"https://github.com/PaquitoSoft/memored/issues"},"devDependencies":{"async":"^0.9.0","chai":"^1.9.1","faker":"^1.1.0","gulp":"^3.8.7","gulp-mocha":"^1.0.0","mocha":"^3.2.0"},"gitHead":"f0297661e3af3fef0228429c0b2e5f82b9a4c985","homepage":"https://github.com/PaquitoSoft/memored#readme","_id":"memored@1.0.0","_shasum":"67d125d566c90a4b19a1ef1e8c85f3f05ab65b8e","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.6","_npmUser":{"name":"paquitosoft","email":"paquitosoftware@gmail.com"},"maintainers":[{"name":"paquitosoft","email":"paquitosoftware@gmail.com"}],"dist":{"shasum":"67d125d566c90a4b19a1ef1e8c85f3f05ab65b8e","tarball":"https://registry.npmjs.org/memored/-/memored-1.0.0.tgz","integrity":"sha512-HpgdgPr7YP7LwSLGL/F53TNGm1y0BL8biAr2dKLcA5s0yWbGwjuJE/uuopoaeEVuSQPogtIIS20mCaoj2l21sw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCR6PGQa4VQQEuJd7gHBZa0LBNaAOqBcEvn6F/sBTtyUwIgeHwedPHJmiahW0gZjHoW7UfrDgjVPGAHKygnFekBECQ="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/memored-1.0.0.tgz_1486932209016_0.9859295636415482"},"directories":{}},"1.1.0":{"name":"memored","version":"1.1.0","description":"Shared in-memory module for cluster applications","main":"index.js","scripts":{"dev":"mocha --ui bdd --reporter spec --no-exit --watch ./spec","test":"mocha --ui bdd --reporter spec --no-exit ./spec"},"author":{"name":"Paquitosoft"},"license":"MIT","keywords":["cache","memory","shared"],"repository":{"type":"git","url":"git+https://github.com/PaquitoSoft/memored.git"},"bugs":{"url":"https://github.com/PaquitoSoft/memored/issues"},"devDependencies":{"async":"^0.9.0","chai":"^1.9.1","faker":"^1.1.0","gulp":"^3.8.7","gulp-mocha":"^1.0.0","mocha":"^3.2.0"},"gitHead":"6e8e41c875d94db5e27f90c2ae17cdc2c0d872b4","homepage":"https://github.com/PaquitoSoft/memored#readme","_id":"memored@1.1.0","_shasum":"b3419e0448e2823ec26cd3a4d9e5fcd5a52b675c","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.6","_npmUser":{"name":"paquitosoft","email":"paquitosoftware@gmail.com"},"maintainers":[{"name":"paquitosoft","email":"paquitosoftware@gmail.com"}],"dist":{"shasum":"b3419e0448e2823ec26cd3a4d9e5fcd5a52b675c","tarball":"https://registry.npmjs.org/memored/-/memored-1.1.0.tgz","integrity":"sha512-ClnH4F/04z5tkBem5ob5mg0AMrGgDduzYCzMKP7zmcnbPVBLi9cYaB7M5fWQWyQpO6BdTjF1mxv8gw1EqXzPjw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdEyTl759uShiO72NeMIwiw5g8FHAzL95XaRPLDW82tAIgLUoFmJgKvtsmCGIR9Z0lpumHgC+O4a+f6UePAX0hd7k="}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/memored-1.1.0.tgz_1486934989372_0.9855781649239361"},"directories":{}},"1.1.1":{"name":"memored","version":"1.1.1","description":"Shared in-memory module for cluster applications","main":"index.js","scripts":{"dev":"mocha --ui bdd --reporter spec --no-exit --watch ./spec","test":"mocha --ui bdd --reporter spec --no-exit ./spec"},"author":{"name":"Paquitosoft"},"license":"MIT","keywords":["cache","memory","shared"],"repository":{"type":"git","url":"git+https://github.com/PaquitoSoft/memored.git"},"bugs":{"url":"https://github.com/PaquitoSoft/memored/issues"},"devDependencies":{"async":"^2.1.4","chai":"^1.9.1","faker":"^1.1.0","mocha":"^3.2.0"},"gitHead":"938e95073d6bc540d344ffa81237b13f7a4f7e7b","homepage":"https://github.com/PaquitoSoft/memored#readme","_id":"memored@1.1.1","_shasum":"7c81c04ee084c956d546ec8db9375ce764f5e746","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"paquitosoft","email":"paquitosoftware@gmail.com"},"maintainers":[{"name":"paquitosoft","email":"paquitosoftware@gmail.com"}],"dist":{"shasum":"7c81c04ee084c956d546ec8db9375ce764f5e746","tarball":"https://registry.npmjs.org/memored/-/memored-1.1.1.tgz","integrity":"sha512-Z1Y0ov373W4xkavKqPTpNtFUiO0gNkgdf1InLpdhO/Vf3LQDpPlFZYY6VxZgH4DiFAxUoE3BPlfCB/6JqwEpdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBqt9HPAL7CRi3LNFNGp7j16GaqAbNUJbvFyayZuYcLIAiAlyovhe+Oe3NEyamWLrQnWH9O4q7HK+wPmFumFgyXh+Q=="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/memored-1.1.1.tgz_1488407407756_0.33459465368650854"},"directories":{}}},"readme":"# Memored\n\nMemored implements an in-memory shared cache to use in nodejs applications which uses [cluster](http://nodejs.org/api/cluster.html) module.\n\nLet's say you want your application to take advantage of multi-core CPUs using nodejs cluster module; you will be able to run several _isolated_ processes which shared nothing but a communication channel with parent process.\nIf you need a fast volatile cache, common solutions would create an in-memory map for every process you run, so you end up with the same data stored several times in your machine RAM.\n\nMemored uses communication channel between master process and its workers to use a unique in-memory storage, reducing the amount of memory your application would use.\n\n## Getting Started\nInstall this module with _npm_:\n```javascript\nnpm install memored\n```\n\nStore and read values is straightforward:\n```javascript\nvar cluster = require('cluster'),\n\tmemored = require('memored');\n\nif (cluster.isMaster) {\n\tcluster.fork();\n} else {\n\tvar han = {\n\t\t\tfirstname: 'Han',\n\t\t\tlastname: 'Solo'\n\t\t},\n\t\tluke = {\n\t\t\tfirstname: 'Luke',\n\t\t\tlastname: 'Skywalker'\n\t\t};\n\n\t// Store and read\n\tmemored.store('character1', han, function() {\n\t\tconsole.log('Value stored!');\n\n\t\tmemored.read('character1', function(err, value) {\n\t\t\tconsole.log('Read value:', value);\n\t\t});\n\t});\n\n\t// You can also set a ttl (milliseconds)\n\tmemored.store('character2', luke, 1000, function(err, expirationTime) {\n\t\tconsole.log('Value stored until:', new Date(expirationTime));\n\n\t\tsetTimeout(function() {\n\t\t\tmemored.read('character2', function(err, value) {\n\t\t\t\tconsole.log('Value is gone?', value === undefined);\n\n\t\t\t\tprocess.exit();\n\t\t\t});\n\t\t}, 1050);\n\t});\n}\n```\n\n## Invalidation management\nBy default, _memored_ will evict cache entries (stored with _ttl_) passively. This is, when you read an expired entry, you will get no value on return and _memored_ will delete the value from its internal cache.\n\nYou can also configure _memored_ to actively evict expired entries every N milliseconds. For this to work, you need to pass the attribute *purgeInterval* to the *setup* function.\nThis will trigger an internal function which looks for expired entries and deletes them from its internal cache.\n\nExample:\n```javascript\nvar cluster = require('cluster'),\n\tasync = require('async'),\n\tmemored = require('memored');\n\nif (cluster.isMaster) {\n\n\tcluster.fork();\n\tmemored.setup({ purgeInterval: 500});\n\n} else {\n\n\tasync.series({\n\t\tstoreValue: function(next) {\n\t\t\tmemored.store('key1', 'My simple string value', 100, next);\n\t\t},\n\t\treadCacheSize: function(next) {\n\t\t\tmemored.size(function(err, size) {\n\t\t\t\tconsole.log('Current size is 1?', size === 1);\n\t\t\t\tnext();\n\t\t\t});\n\t\t},\n\t\twait: function(next) {\n\t\t\tsetTimeout(next, 600);\n\t\t},\n\t\treadCacheSizeAgain: function(next) {\n\t\t\tmemored.size(function(err, size) {\n\t\t\t\tconsole.log('Current size is 0?', size === 0);\n\t\t\t\tnext();\n\t\t\t});\n\t\t}\n\t}, process.exit);\n}\n```\n\n## API\nDocumentation for every module function:\n\n\n### setup(options)\n\nThis function is used to configure _memored_.\n\n**Arguments**:\n\n- **purgeInterval** {Number} (optional): Configures and triggers _memored_ expired entries auto deletion. Value expressed in milliseconds. _It's only used when called this method from the master process of your application_.\n- **logger** {Object} (optional): In you want _memored_ to log something, you must provide an object implementing *log* and *warn* functions.\n\n**Example**:\n```javascript\nmemored.setup({\n\tpurgeInterval: 15000,\n\tlogger: console\n});\n```\n\n### store(key, value, [ttl], [callback])\n\nThis function stores a value in the cache.\n_It is intended to be called from a worker process_.\n\n**Arguments**:\n\n- **key** {String} (required): Key used to lookup the entry\n- **value** {Mixed} (required): Whatever you want to store\n- **ttl** {Number} (optional): Time to live for this value in the cache (milliseconds)\n- **callback** {Function} (optional): Function to be call on store completion. Callback arguments:\n\t- _err_ {Error}: Optional error\n\t- _expirationTime_ {Number}: The timestamp of the moment when this entry will expire. If _ttl_ is not used, this value will be undefined.\n\n**Examples**:\n```javascript\nmemored.store('key1', {firstname: 'Han', lastname: 'Solo'}, function() {\n\tconsole.log('Value stored!');\n});\n\nmemored.store('key2', ['a', 'b', 'c'], 15000, function(err, expirationTime) {\n\tconsole.log('This value will expire on:', new Date(expirationTime));\n});\n```\n\n### multiStore(map, [ttl], [callback])\n\nThis function stores several values in the cache.\n_It is intended to be called from a worker process_.\n\n**Arguments**:\n\n- **map** {Object} (required): Map where the keys represents the keys for the entry in the cache and the values represent the data to be stored.\n- **ttl** {Number} (optional): Time to live for this value in the cache (milliseconds). All the entries will have the same _ttl_. As all entries will be stored in the same _tick_, its expiration time will be practically the same.\n- **callback** {Function} (optional): Function to be call on store completion. Callback arguments:\n\t- _err_ {Error}: Optional error\n\t- _expirationTime_ {Number}: The timestamp of the moment when the first of the entries will expire. If _ttl_ is not used, this value will be undefined.\n\n**Examples**:\n```javascript\nvar users = {\n    'user1': { name: 'Han Solo' },\n    'user2': { name: 'Princess Leia' },\n    'user3': { name: 'Luke Skywalker' }\n};\nmemored.multiStore(users, function() {\n    console.log('Users saved');\n});\n\nmemored.multiStore(users, 15000, function(err, expirationTime) {\n    console.log('First value will expire on:', new Date(expirationTime));\n});\n```\n\n\n### read(key, callback)\n\nThis function reads a value from the cache.\n_It is intended to be called from a worker process_.\n\n**Arguments**:\n\n- **key** {String} (required): Key used to lookup the entry\n- **callback** {Function} (required): Function to be called on read completion. Callback arguments:\n\t- _err_ {Error}: Optional error\n\t- _value_ {Mixed}: Contents of the cached entry. If the value is not found or is expired, it will be undefined.\n\n**Example**:\n```javascript\nmemored.read('key1', function(err, value) {\n\tconsole.log('Key1 value:', value);\n});\n\nmemored.read('key1', function(err, value, expirationTime) {\n\tconsole.log('Key1 value:', value);\n\tconsole.log('Key1 expiration time:', new Date(expirationTime));\n});\n\nmemored.read('unknownKey', function(err, value) {\n\tconsole.log('No data read?', value === undefined);\n});\n```\n\n### multiRead(keys, callback)\n\nThis function reads several values from the cache.\n_It is intended to be called from a worker process_.\n\n**Arguments**:\n\n- **keys** {Array(string)} (required): List of keys to lookup entries in the cache\n- **callback** {Function} (required): Function to be called on read completion. Callback arguments:\n\t- _err_ {Error}: Optional error\n    - _values_ {Object}: An object where its keys will be the keys used in the _keys_ array and their values will be objects representing cached entries with the attributes _value_ and _expirationTime_. If a cache entry is not found for a given key, that key will not be included in the _values_. Only found entries will exist in the result.\n    \n**Example**;\n```javascript\nmemored.multiRead(['key1', 'key2', 'unknownKey'], function(err, values) {\n    console.log('Key1 value:', values.key1.value);\n    console.log('Key1 expiration time:', values.key1.expirationTime);\n    \n    console.log(Object.keys(values)); // ['key1', 'key2']\n    \n    console.log('unknownKey:', values.unknownKey); // undefined\n});\n```\n\n### remove(key, callback)\n\nThis function removes an entry from the cache.\n_It is intended to be called from a worker process_.\n\n**Arguments**:\n\n- **key** {String} (required): Key for the entry to be removed.\n- **callback** {Function} (optional): Function to be called on removal completion.\n\n**Example**:\n```javascript\nmemored.remove('key1', function() {\n\tconsole.log('Key removed from the cache.');\n});\n```\n\n### multiRemove(keys, callback)\n\nThis function removes several entries from the cache.\n_It is intended to be called from a worker process_.\n\n**Arguments**:\n\n- **keys** {Array(string)} (required): Keys for the entries to be removed. If any key is not found in the cache, it's just ignored.\n- **callback** {Function} (optional): Function to be called on removal completion.\n\n**Example**:\n```javascript\nmemored.multiRemove(['key1', 'key2', 'unknownKey'], function() {\n    console.log('Entries foundn in the cache has been removed.')\n});\n```\n\n### clean(callback)\n\nThis function removes all the entries from the cache.\n_It is intended to be called from a worker process_.\n\n**Arguments**:\n\n- **callback** {Function} (optional): Function to be called on read completion.\n\n**Example**:\n```javascript\nmemored.clean(function() {\n\tconsole.log('All cache entries have been deleted.');\n});\n```\n\n### size(callback)\n\nThis function returns the number of entries in the cache.\n\n**Arguments**:\n\n- **callback** {Function} (required): Function to be called on size calculation is complete. Callback arguments:\n\t- _err_ {Error}: Optional error\n\t- _size_ {Number}: The number of entries in the cache.\n\n**Example**:\n\n```javascript\nmemored.size(function(err, size) {\n\tconsole.log('Cache size:', size);\n});\n```\n\n### keys(callback)\n\nThis function returns an array of the keys for objects in the cache.\n\n**Arguments**:\n\n- **callback** {Function} (required): Function to be called when keys calculation is complete. Callback arguments:\n\t- _err_ {Error}: Optional error\n\t- _keys_ {Array}: An array of strings for the keys of the entries in the cache.\n\n**Example**:\n\n```javascript\nmemored.keys(function(err, keys) {\n\tconsole.log('Cache keys:', keys);\n});\n```\n\n### version\n\nThis is an attribute which provides module's version number\n\n\n# Final note\nAll the callbacks first parameter is an optional error object. Actually, this param will never be an error because there is no expected error in the internal code. There's no function call that can possible throw an expected error that this module would deal with.\nThe existence of this param is to follow the *convention* about libraries callbacks in nodejs. As everybody expects this first callback parameter to be an optional one, I decided to include it.\n\n- [Nodeguide](http://nodeguide.com/style.html#callbacks)\n- [Nodejitsu](http://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions)\n- [GoSquared](https://engineering.gosquared.com/node-js-error-handling-callbacks-vs-promises)\n\n\n## License\nCopyright (c) 2014 PaquitoSoft  \nLicensed under the MIT license.","maintainers":[{"name":"paquitosoft","email":"paquitosoftware@gmail.com"}],"time":{"modified":"2022-06-19T17:45:44.882Z","created":"2014-09-13T17:34:47.841Z","0.0.1":"2014-09-13T17:34:47.841Z","0.0.2":"2014-09-13T17:37:36.430Z","0.0.3":"2014-09-13T17:41:59.653Z","0.0.4":"2014-09-14T15:53:10.447Z","0.1.0":"2015-06-10T20:08:02.981Z","1.0.0":"2017-02-12T20:43:31.014Z","1.1.0":"2017-02-12T21:29:50.140Z","1.1.1":"2017-03-01T22:30:09.858Z"},"author":{"name":"Paquitosoft"},"license":"MIT","readmeFilename":"README.md","keywords":["cache","memory","shared"],"homepage":"https://github.com/PaquitoSoft/memored#readme","repository":{"type":"git","url":"git+https://github.com/PaquitoSoft/memored.git"},"bugs":{"url":"https://github.com/PaquitoSoft/memored/issues"},"users":{"tacoc0815":true,"bengi":true,"mjurincic":true,"ngpvnk":true}}