{"id":16440469,"url":"https://github.com/icai/node-cache","last_synced_at":"2025-04-04T16:20:08.412Z","repository":{"id":57311247,"uuid":"189137868","full_name":"icai/node-cache","owner":"icai","description":"node cache provider using mongodb, redis, memcache, lru, mysql, file.","archived":false,"fork":false,"pushed_at":"2019-06-02T12:55:11.000Z","size":63,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T08:49:10.611Z","etag":null,"topics":["cache","file-cache","memcache","mongodb","mongodb-cache","mysql-cache","node-cache","redis","redis-cache"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/node-caches","language":"TypeScript","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/icai.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":"2019-05-29T02:41:44.000Z","updated_at":"2020-01-05T08:36:23.000Z","dependencies_parsed_at":"2022-09-06T03:32:39.836Z","dependency_job_id":null,"html_url":"https://github.com/icai/node-cache","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icai%2Fnode-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icai%2Fnode-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icai%2Fnode-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icai%2Fnode-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icai","download_url":"https://codeload.github.com/icai/node-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208371,"owners_count":20901570,"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","file-cache","memcache","mongodb","mongodb-cache","mysql-cache","node-cache","redis","redis-cache"],"created_at":"2024-10-11T09:12:10.467Z","updated_at":"2025-04-04T16:20:08.391Z","avatar_url":"https://github.com/icai.png","language":"TypeScript","readme":"# node-cache\nnode cache provider using redis, memcache, lru, mysql, file\n\n\n## Install\n\n```\nnpm i node-caches --save\n\n```\n\nyou need to install some dependencies for provider.\n\n- Mysql\n```\n  npm i sequelize mysql2 --save\n```\n- Memcache\n```\n  npm i memcache-plus sequelize mysql2 --save\n```\n- File \n```\n  npm i cacache --save \n```\n- Redis\n```\n  npm i ioredis --save  \n```\n- LRU\n```\n  npm i lru-cache --save\n```\n- Mongodb\n```\nnpm i mongoose --save\n\n```\n\n## Setup\n\n```js\n\nimport { config } from 'node-caches'\n\n```\n\nmysql\n\n```js\nmysql = config({\n  store: 'mysql',\n  options: {\n    database: 'ncache',\n    username: 'root',\n    password: 'root123456',\n    host: 'localhost'\n  }\n})\n\n```\n\n`options` parameters will be passed to http://docs.sequelizejs.com/class/lib/sequelize.js~Sequelize.html#instance-constructor-constructor\n\nmemcache\n\n```js\n  mem = config({\n    store: 'memcache',\n    options: {\n      hosts: ['127.0.0.1:11211'],\n      mysql: {\n        database: 'ncache',\n        username: 'root',\n        password: 'root123456',\n        host: 'localhost'\n      }\n    }\n  })\n\n```\n\n`options` parameters will be passed to https://github.com/victorquinn/memcache-plus/blob/master/docs/initialization.md#options\n\n`options.mysql` parameters will be passed to http://docs.sequelizejs.com/class/lib/sequelize.js~Sequelize.html#instance-constructor-constructor\n\nfile\n\n```js\n  file = config({\n    store: 'file',\n    options: {\n      path: path.resolve(__dirname, '.cache')\n    }\n  })\n```\n\n\nredis\n\n```js\n  redis = config({\n    store: 'redis',\n    options: {\n      port: 6379,\n      host: '127.0.0.1'\n    }\n  })\n```\n`options` parameters will be passed to https://github.com/luin/ioredis/blob/master/API.md#new_Redis_new\n\nlru\n\n```js\n  lru = config({\n    store: 'lru',\n    options: {\n      max: 500,\n      maxAge: 1000 * 60 * 60\n    }\n  })\n```\n\n`options` parameters will be passed to  https://github.com/isaacs/node-lru-cache#options\n\nmongodb\n\n```js\n  mongodb = config({\n    store: 'mongodb',\n    options: {\n      url: 'mongodb://localhost:27017'\n    }\n  })\n```\n\n## implements ICache API\n\n```js\nexport interface ICache {\n  read: Function,\n  write: Function,\n  delete: Function,\n  search: Function,\n  clean: Function\n}\n```\n\nAlso see the [API Documentation](API.md)\n\n\n\n\n\n\n## LICENSE\n\nCopyright (c) Terry Cai. Licensed under the MIT license.\n\n\n\n\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficai%2Fnode-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficai%2Fnode-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficai%2Fnode-cache/lists"}