{"id":20900307,"url":"https://github.com/jsnomad/cache-lite","last_synced_at":"2026-04-19T21:39:01.335Z","repository":{"id":57192445,"uuid":"59854637","full_name":"jsnomad/cache-lite","owner":"jsnomad","description":"Node in-memory caching system","archived":false,"fork":false,"pushed_at":"2016-06-26T19:29:18.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-11T11:51:38.392Z","etag":null,"topics":["cache","lite","nodejs"],"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/jsnomad.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":"2016-05-27T18:19:05.000Z","updated_at":"2017-02-22T07:25:47.000Z","dependencies_parsed_at":"2022-08-24T03:10:31.220Z","dependency_job_id":null,"html_url":"https://github.com/jsnomad/cache-lite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsnomad%2Fcache-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsnomad%2Fcache-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsnomad%2Fcache-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsnomad%2Fcache-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsnomad","download_url":"https://codeload.github.com/jsnomad/cache-lite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243285620,"owners_count":20266849,"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","lite","nodejs"],"created_at":"2024-11-18T11:18:53.912Z","updated_at":"2025-12-26T21:51:47.426Z","avatar_url":"https://github.com/jsnomad.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM Badge](https://nodei.co/npm/cache-lite.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://www.npmjs.com/package/cache-lite)\n\n# cache-lite [![CircleCI](https://circleci.com/gh/jsnomad/cache-lite.svg?style=svg)](https://circleci.com/gh/jsnomad/cache-lite)\n\n## Description\nSimple node in-memory caching system\n\n## Download\nThe source is available for download from\n[GitHub](https://github.com/jsnomad/cache-lite).\nAlternatively, you can install using Node Package Manager (npm):\n\u003cpre\u003e\n  npm install cache-lite\n\u003c/pre\u003e\n\n## Example\n```js\nconst CacheLite = require('cache-lite');\n\nconst cache = new CacheLite()\n\n// Set value in the cache for 200ms\ncache.set(\"myKey\", \"myData\", 200).then(() =\u003e {\n})\n\n// Get value from the cache\ncache.get(\"myKey\").then((value) =\u003e {\n  console.log(value); // myData\n})\n\ncache.getKeys() // [ 'myKey' ]\n\ncache.size() // 1\n\n//Get value from the cache after 300ms\nsetTimeout(() =\u003e {\n  cache.get(\"myKey\").then((value) =\u003e {\n  }).catch((err) =\u003e {\n    // Error: The key myKey doesn't exist in the cache\n  })\n}, 300);\n\n```\n\n## API\n###set(key, value, ttl)\nReturns a promises\n#### key\n\nType: `string`\n\nKey\n\n#### value\n\nType: `string`\n\nValue\n\n#### ttl (optional)\n\nType: `number`\n\nTime to live\n\n###get(key)\nReturns a promises\n#### key\n\nType: `string`\n\nKey\n\n###getKeys()\nReturns keys stored in the cache\n\n###size()\nReturns the number of elements in the cache\n\n###clear()\nDelete all cached values from the cache\n\n## Requirement\nNode \u003e= 5.0\n\n## License\nMIT \u0026copy; [Thomas Blanc-Hector](https://github.com/jsnomad)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsnomad%2Fcache-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsnomad%2Fcache-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsnomad%2Fcache-lite/lists"}