{"id":28491016,"url":"https://github.com/pasupulaphani/node-cache-redis","last_synced_at":"2025-07-08T01:31:42.531Z","repository":{"id":12938919,"uuid":"73188559","full_name":"pasupulaphani/node-cache-redis","owner":"pasupulaphani","description":"Redis cache ready to scale with node-pool, semaphore support","archived":false,"fork":false,"pushed_at":"2023-01-07T18:17:35.000Z","size":4406,"stargazers_count":13,"open_issues_count":11,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-23T04:06:36.802Z","etag":null,"topics":["cache","connection-pooling","generic-pool","node-pool","redis","redis-cache","scalable","scale","semaphore","serialization","store"],"latest_commit_sha":null,"homepage":"https://pasupulaphani.github.io/node-cache-redis/modules/_rediscache_.html","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pasupulaphani.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-08T13:29:02.000Z","updated_at":"2024-06-02T14:49:15.000Z","dependencies_parsed_at":"2023-01-11T18:27:13.929Z","dependency_job_id":null,"html_url":"https://github.com/pasupulaphani/node-cache-redis","commit_stats":null,"previous_names":["pasupulaphani/simple-redis-cache"],"tags_count":48,"template":true,"template_full_name":null,"purl":"pkg:github/pasupulaphani/node-cache-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pasupulaphani%2Fnode-cache-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pasupulaphani%2Fnode-cache-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pasupulaphani%2Fnode-cache-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pasupulaphani%2Fnode-cache-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pasupulaphani","download_url":"https://codeload.github.com/pasupulaphani/node-cache-redis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pasupulaphani%2Fnode-cache-redis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264175365,"owners_count":23568451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cache","connection-pooling","generic-pool","node-pool","redis","redis-cache","scalable","scale","semaphore","serialization","store"],"created_at":"2025-06-08T07:31:08.618Z","updated_at":"2025-07-08T01:31:42.524Z","avatar_url":"https://github.com/pasupulaphani.png","language":"TypeScript","funding_links":["http://patreon.com/phaninder"],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/node-cache-redis.svg)](https://badge.fury.io/js/node-cache-redis)\n[![Build Status](https://travis-ci.org/pasupulaphani/node-cache-redis.svg?branch=master)](https://travis-ci.org/pasupulaphani/node-cache-redis)\n[![Coverage Status](https://coveralls.io/repos/github/pasupulaphani/node-cache-redis/badge.svg?branch=master)](https://coveralls.io/github/pasupulaphani/node-cache-redis?branch=master)\n[![Patreon donate button](https://img.shields.io/badge/patreon-donate-yellow.svg)](http://patreon.com/phaninder 'Donate to this project using Patreon')\n\n# node-cache-redis [![See on Github](https://github.com/themes/tactile/images/octocat-icon.png)](https://github.com/pasupulaphani/node-cache-redis)\n\nSimplistic node redis cache ready can scale with generic-pool support\n\n\u003e Cache Early; Cache Often\n\n### Documentation\n\n- [TSDOC pages](https://pasupulaphani.github.io/node-cache-redis/index.html)\n\n## Prerequisites\n\n- `node \u003e= 8` This module requires nodejs v8 or later\n- `redis \u003e= 4` This module requires redis v4 or above as it has dependencies on `UNLINK` and `redis.replicate_commands()` for pattern deletion.\n\n## Featuring\n\n- Works out of the box\n- Easy to scale with low friction during locking and purging\n- Designed for multithread environment\n- Logging can be customized\n- Flexible Expiration: Through configuration, you can set a default expiration mode and time for each layer.\n- Statistics / Counters: Gather statistical information.\n- Modular Design\n\n## Migration\n\n[4.0.0](https://github.com/pasupulaphani/node-cache-redis/releases/tag/v4.0.0) contains braking change. See\n[CHANGELOG.md](https://github.com/pasupulaphani/node-cache-redis/blob/master/CHANGELOG.md)\n\n### Getting started\n\n```\n    npm install node-cache-redis\n```\n\n#### Usage\n\n```\n    const { init, set, get } = require(\"node-cache-redis\");\n    init();\n\n    // set\n    await set(\"key\", { \"hello\": \"world\" })\n    const value = await get(\"key\")\n```\n\n#### API\n\n- init([options]) [TSDOC init](https://pasupulaphani.github.io/node-cache-redis/index.html#init)\n\n#### `options` object properties\n\n\u003ctable class=\"params\"\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eName\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth class=\"last\"\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd class=\"name\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/td\u003e\n      \u003ctd class=\"type\"\u003e\n        \u003cspan class=\"param-type\"\u003estring\u003c/span\u003e\n      \u003c/td\u003e\n      \u003ctd class=\"description last\"\u003e\n        \u003cp\u003eName your store\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd class=\"name\"\u003e\u003ccode\u003eredisOptions\u003c/code\u003e\u003c/td\u003e\n      \u003ctd class=\"type\"\u003e\n        \u003cspan class=\"param-type\"\u003eobject\u003c/span\u003e\n      \u003c/td\u003e\n      \u003ctd class=\"description last\"\u003e\n        \u003cp\u003eopts from \u003ca href=\"https://github.com/NodeRedis/node_redis#options-object-properties\"\u003enode_redis#options-object-properties\u003c/a\u003e\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd class=\"name\"\u003e\u003ccode\u003epoolOptions\u003c/code\u003e\u003c/td\u003e\n      \u003ctd class=\"type\"\u003e\n        \u003cspan class=\"param-type\"\u003eobject\u003c/span\u003e\n      \u003c/td\u003e\n      \u003ctd class=\"description last\"\u003e\n        \u003cp\u003eopts from \u003ca href=\"https://github.com/coopernurse/node-pool#createpool\"\u003enode-pool#createpool\u003c/a\u003e\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd class=\"name\"\u003e\u003ccode\u003elogger\u003c/code\u003e\u003c/td\u003e\n      \u003ctd class=\"type\"\u003e\n        \u003cspan class=\"param-type\"\u003eobject\u003c/span\u003e\n      \u003c/td\u003e\n      \u003ctd class=\"description last\"\u003e\n        \u003cp\u003eInject your custom logger\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd class=\"name\"\u003e\u003ccode\u003ettlInSeconds\u003c/code\u003e\u003c/td\u003e\n      \u003ctd class=\"type\"\u003e\n        \u003cspan class=\"param-type\"\u003enumber\u003c/span\u003e\n      \u003c/td\u003e\n      \u003ctd class=\"description last\"\u003e\n        \u003cp\u003eDefault time to live for stored values\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Run tests\n\n##### Using docker\n\n```\nbash test.sh\n```\n\n##### Run manually\n\n```\ndocker run -it -p 6379:6379 redis\nnpm t\n```\n\n##### Todo:\n\n- Serialization: Used to serialize values in distributed scenarios and configuration.\n- Synchronized locking with a semaphore\n\n## Contribute\n\n[Discover how you can contribute by heading on over to the `CONTRIBUTING.md` file.](https://github.com/pasupulaphani/node-cache-redis/blob/master/CONTRIBUTING.md)\n\n## Backers\n\n### Maintainers\n\nThese amazing people are maintaining this project:\n\n- [Phaninder](https://github.com/pasupulaphani) — [view contributions](https://github.com/pasupulaphani/node-cache-redis/commits?author=pasupulaphani)\n\n### Sponsors\n\nNo sponsors yet! Will you be the first?\n\n[![Patreon donate button](https://img.shields.io/badge/patreon-donate-yellow.svg)](http://patreon.com/phaninder 'Donate to this project using Patreon')\n[![Flattr donate button](https://img.shields.io/badge/flattr-donate-yellow.svg)](https://flattr.com/profile/pasupulaphani 'Donate to this project using Flattr')\n\n\u003c!-- [![PayPal donate button](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://phaninder.com/paypal \"Donate to this project using Paypal\") --\u003e\n\u003c!-- [![Bitcoin donate button](https://img.shields.io/badge/bitcoin-donate-yellow.svg)](https://phaninder.com/bitcoin \"Donate once-off to this project using Bitcoin\") --\u003e\n\u003c!-- [![Wishlist browse button](https://img.shields.io/badge/wishlist-donate-yellow.svg)](https://phaninder.com/wishlist \"Buy an item on our wishlist for us\") --\u003e\n\u003c!-- \u003ca href='https://pledgie.com/campaigns/33095'\u003e\u003cimg alt='Click here to lend your support to: simple-node-redis-cache and make a donation at pledgie.com !' src='https://pledgie.com/campaigns/33095.png?skin_name=chrome' border='0' \u003e\u003c/a\u003e --\u003e\n\n### Contributors\n\nAmazing people who have contributed code to this project:\n\n- Ron Yang\n- [Oliver Brooks](https://github.com/oliverbrooks)\n\nFeel free to make changes. Please see the [Contributors' Guide](https://github.com/pasupulaphani/node-cache-redis/blob/master/CONTRIBUTING.md) for more information on contributing to the documentation.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpasupulaphani%2Fnode-cache-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpasupulaphani%2Fnode-cache-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpasupulaphani%2Fnode-cache-redis/lists"}