{"id":26930235,"url":"https://github.com/dial-once/node-cache-manager-redis","last_synced_at":"2026-03-04T21:35:17.385Z","repository":{"id":24820666,"uuid":"28235132","full_name":"dial-once/node-cache-manager-redis","owner":"dial-once","description":"Node cache store for Redis","archived":false,"fork":false,"pushed_at":"2019-01-16T01:40:35.000Z","size":154,"stargazers_count":67,"open_issues_count":13,"forks_count":29,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2025-10-29T02:52:39.967Z","etag":null,"topics":["javascript","nodejs","redis","redis-store"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dial-once.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-19T15:41:14.000Z","updated_at":"2025-09-22T06:19:04.000Z","dependencies_parsed_at":"2022-07-25T14:32:26.207Z","dependency_job_id":null,"html_url":"https://github.com/dial-once/node-cache-manager-redis","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/dial-once/node-cache-manager-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dial-once%2Fnode-cache-manager-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dial-once%2Fnode-cache-manager-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dial-once%2Fnode-cache-manager-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dial-once%2Fnode-cache-manager-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dial-once","download_url":"https://codeload.github.com/dial-once/node-cache-manager-redis/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dial-once%2Fnode-cache-manager-redis/sbom","scorecard":{"id":340677,"data":{"date":"2025-08-11","repo":{"name":"github.com/dial-once/node-cache-manager-redis","commit":"e73902ebe398b2f637e78358df2d2baa6725ebd5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":4,"reason":"Found 5/12 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T05:46:02.405Z","repository_id":24820666,"created_at":"2025-08-18T05:46:02.405Z","updated_at":"2025-08-18T05:46:02.405Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30094029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T20:42:30.420Z","status":"ssl_error","status_checked_at":"2026-03-04T20:42:30.057Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","nodejs","redis","redis-store"],"created_at":"2025-04-02T06:17:34.658Z","updated_at":"2026-03-04T21:35:12.360Z","avatar_url":"https://github.com/dial-once.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Node Cache Manager store for Redis\n==================================\n\n(https://david-dm.org/dial-once/node-cache-manager-redis.svg)](https://david-dm.org/dial-once/node-cache-manager-redis)\n[![Sonar](http://proxy.dialonce.net/sonar/api/badges/gate?key=node-cache-manager-redis)](http://sonar.dialonce.net/dashboard?id=node-cache-manager-redis)\n[![Sonar](http://proxy.dialonce.net/sonar/api/badges/measure?key=node-cache-manager-redis\u0026metric=ncloc)](http://sonar.dialonce.net/dashboard?id=node-cache-manager-redis)\n[![Sonar](http://proxy.dialonce.net/sonar/api/badges/measure?key=node-cache-manager-redis\u0026metric=coverage)](http://sonar.dialonce.net/dashboard?id=node-cache-manager-redis)\n[![Sonar](http://proxy.dialonce.net/sonar/api/badges/measure?key=node-cache-manager-redis\u0026metric=code_smells)](http://proxy.dialonce.net/sonar/api/badges/measure?key=node-cache-manager-redis\u0026metric=coverage)\n[![Sonar](http://proxy.dialonce.net/sonar/api/badges/measure?key=node-cache-manager-redis\u0026metric=bugs)](http://sonar.dialonce.net/dashboard?id=node-cache-manager-redis)\n[![Sonar](http://proxy.dialonce.net/sonar/api/badges/measure?key=node-cache-manager-redis\u0026metric=sqale_debt_ratio)](http://sonar.dialonce.net/dashboard?id=node-cache-manager-redis)\n\nThe Redis store for the [node-cache-manager](https://github.com/BryanDonovan/node-cache-manager) module.\n\nInstallation\n------------\n\n```sh\nnpm install cache-manager-redis --save\n```\n\nUsage examples\n--------------\n\nHere are examples that demonstrate how to implement the Redis cache store.\n\n### Single store\n\n```js\nvar cacheManager = require('cache-manager');\nvar redisStore = require('cache-manager-redis');\n\nvar redisCache = cacheManager.caching({\n\tstore: redisStore,\n\thost: 'localhost', // default value\n\tport: 6379, // default value\n\tauth_pass: 'XXXXX',\n\tdb: 0,\n\tttl: 600\n});\n\nvar ttl = 5;\n\n// listen for redis connection error event\nredisCache.store.events.on('redisError', function(error) {\n\t// handle error here\n\tconsole.log(error);\n});\n\nredisCache.set('foo', 'bar', { ttl: ttl }, function(err) {\n    if (err) {\n      throw err;\n    }\n\n    redisCache.get('foo', function(err, result) {\n        console.log(result);\n        // \u003e\u003e 'bar'\n        redisCache.del('foo', function(err) {});\n    });\n});\n\nfunction getUser(id, cb) {\n    setTimeout(function () {\n        console.log(\"Returning user from slow database.\");\n        cb(null, {id: id, name: 'Bob'});\n    }, 100);\n}\n\nvar userId = 123;\nvar key = 'user_' + userId;\n\n// Note: ttl is optional in wrap()\nredisCache.wrap(key, function (cb) {\n    getUser(userId, cb);\n}, { ttl: ttl }, function (err, user) {\n    console.log(user);\n\n    // Second time fetches user from redisCache\n    redisCache.wrap(key, function (cb) {\n        getUser(userId, cb);\n    }, function (err, user) {\n        console.log(user);\n    });\n});\n\n// The del() method accepts a single key or array of keys,\n// with or without a callback.\nredisCache.set('foo', 'bar', function () {\n    redisCache.set('bar', 'baz', function() {\n        redisCache.set('baz', 'foo', function() {\n          redisCache.del('foo');\n          redisCache.del(['bar', 'baz'], function() { });\n        });\n    });\n});\n\n// The keys() method uses the Redis SCAN command and accepts\n// optional `pattern` and `options` arguments. The `pattern`\n// must be a Redis glob-style string and defaults to '*'. The\n// options argument must be an object and accepts a single\n// `scanCount` property, which determines the number of elements\n// returned internally per call to SCAN. The default `scanCount`\n// is 100.\nredisCache.set('foo', 'bar', function () {\n    redisCache.set('far', 'boo', function () {\n        redisCache.keys('fo*', function (err, arrayOfKeys) {\n            // arrayOfKeys: ['foo']\n        });\n\n        redisCache.keys(function (err, arrayOfKeys) {\n            // arrayOfKeys: ['foo', 'far']\n        });\n\n        redisCache.keys('fa*', { scanCount: 10 }, function (err, arrayOfKeys) {\n            // arrayOfKeys: ['far']\n        });\n    });\n});\n\n```\n\n### Multi-store\n\n```js\nvar cacheManager = require('cache-manager');\nvar redisStore = require('cache-manager-redis');\n\nvar redisCache = cacheManager.caching({store: redisStore, db: 0, ttl: 600});\nvar memoryCache = cacheManager.caching({store: 'memory', max: 100, ttl: 60});\n\nvar multiCache = cacheManager.multiCaching([memoryCache, redisCache]);\n\n\nuserId2 = 456;\nkey2 = 'user_' + userId;\nttl = 5;\n\n// Sets in all caches.\nmultiCache.set('foo2', 'bar2', { ttl: ttl }, function(err) {\n    if (err) { throw err; }\n\n    // Fetches from highest priority cache that has the key.\n    multiCache.get('foo2', function(err, result) {\n        console.log(result);\n        // \u003e\u003e 'bar2'\n\n        // Delete from all caches\n        multiCache.del('foo2');\n    });\n});\n\n// Note: ttl is optional in wrap()\nmultiCache.wrap(key2, function (cb) {\n    getUser(userId2, cb);\n}, { ttl: ttl }, function (err, user) {\n    console.log(user);\n\n    // Second time fetches user from memoryCache, since it's highest priority.\n    // If the data expires in the memory cache, the next fetch would pull it from\n    // the 'someOtherCache', and set the data in memory again.\n    multiCache.wrap(key2, function (cb) {\n        getUser(userId2, cb);\n    }, function (err, user) {\n        console.log(user);\n    });\n});\n```\n\n### Using a URL instead of options (if url is correct it overrides options host, port, db, auth_pass and ttl)\nUrls should be in this format `redis://[:password@]host[:port][/db-number][?ttl=value]`\n```js\nvar cacheManager = require('cache-manager');\nvar redisStore = require('cache-manager-redis');\n\nvar redisCache = cacheManager.caching({\n\tstore: redisStore,\n\turl: 'redis://:XXXX@localhost:6379/0?ttl=600'\n});\n\n// proceed with redisCache\n```\n\n### Seamless compression (currently only supports Node's built-in zlib / gzip implementation)\n\n```js\n// Compression can be configured for the entire cache.\nvar redisCache = cacheManager.caching({\n\tstore: redisStore,\n\thost: 'localhost', // default value\n\tport: 6379, // default value\n\tauth_pass: 'XXXXX',\n\tdb: 0,\n\tttl: 600,\n\tcompress: true\n});\n\n// Or on a per command basis. (only applies to get / set / wrap)\nredisCache.set('foo', 'bar', { compress: false }, function(err) {\n    if (err) {\n      throw err;\n    }\n\n    redisCache.get('foo', { compress: false }, function(err, result) {\n        console.log(result);\n        // \u003e\u003e 'bar'\n        redisCache.del('foo', function(err) {});\n    });\n});\n\n// Setting the compress option to true will enable a default configuration\n// for best speed using gzip. For advanced use, a configuration object may\n// also be passed with implementation-specific parameters. Currently, only\n// the built-in zlib/gzip implementation is supported.\nvar zlib = require('zlib');\nvar redisCache = cacheManager.caching({\n\tstore: redisStore,\n\thost: 'localhost', // default value\n\tport: 6379, // default value\n\tauth_pass: 'XXXXX',\n\tdb: 0,\n\tttl: 600,\n\tcompress: {\n\t  type: 'gzip',\n\t  params: {\n\t    level: zlib.Z_BEST_COMPRESSION\n\t  }\n\t}\n});\n```\nCurrently, all implementation-specific configuration parameters are passed directly to the `zlib.gzip` and `zlib.gunzip` methods. Please see the [Node Zlib documentation](https://nodejs.org/dist/latest-v6.x/docs/api/zlib.html#zlib_class_options) for available options.\n\nTests\n-----\n\n1. Run a Redis server\n2. Run tests `npm test` or `npm run coverage`\n\n\nContribution\n------------\n\nIf you would like to contribute to the project, please fork it and send us a pull request. Please add tests for any new features or bug fixes. Also make sure the code coverage is not impacted.\n\n\nLicense\n-------\n\n`node-cache-manager-redis` is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdial-once%2Fnode-cache-manager-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdial-once%2Fnode-cache-manager-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdial-once%2Fnode-cache-manager-redis/lists"}