{"id":49232755,"url":"https://github.com/ebenezerdon/ts-node-cache","last_synced_at":"2026-04-24T12:35:20.373Z","repository":{"id":232564932,"uuid":"784169493","full_name":"ebenezerdon/ts-node-cache","owner":"ebenezerdon","description":"TS-Node-Cache is a TypeScript-based caching solution that's simple and lightweight. It supports data caching with optional expiration and callbacks.","archived":false,"fork":false,"pushed_at":"2024-04-15T17:13:53.000Z","size":54,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T14:55:31.024Z","etag":null,"topics":["cache","cache-storage","caching","node","typscript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@ebenezerdon/ts-node-cache","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ebenezerdon.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-09T10:19:36.000Z","updated_at":"2024-11-09T10:35:02.000Z","dependencies_parsed_at":"2024-04-15T18:43:20.271Z","dependency_job_id":null,"html_url":"https://github.com/ebenezerdon/ts-node-cache","commit_stats":null,"previous_names":["ebenezerdon/ts-node-cache"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ebenezerdon/ts-node-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebenezerdon%2Fts-node-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebenezerdon%2Fts-node-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebenezerdon%2Fts-node-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebenezerdon%2Fts-node-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ebenezerdon","download_url":"https://codeload.github.com/ebenezerdon/ts-node-cache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebenezerdon%2Fts-node-cache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32224404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T10:26:35.452Z","status":"ssl_error","status_checked_at":"2026-04-24T10:25:27.643Z","response_time":64,"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":["cache","cache-storage","caching","node","typscript"],"created_at":"2026-04-24T12:35:17.339Z","updated_at":"2026-04-24T12:35:20.359Z","avatar_url":"https://github.com/ebenezerdon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TS-Node-Cache\n\nTS-Node-Cache is a TypeScript-based caching solution that's simple and lightweight. It supports data caching with optional expiration and callbacks. Similar to [memory-cache](https://www.npmjs.com/package/memory-cache) but with modern implementation and TypeScript support.\n\n[![npm version](https://badge.fury.io/js/%40ebenezerdon%2Fts-node-cache.svg)](https://badge.fury.io/js/%40ebenezerdon%2Fts-node-cache)\n[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)\n\n## Features\n\n- Stores any data type.\n- Allows setting expiration time for entries.\n- Supports custom callbacks on expiration.\n- Debug mode for tracking cache activity.\n- Serialize cache to/from JSON.\n\n## Installation\n\n```bash\nnpm install @ebenezerdon/ts-node-cache\n```\n\n## Usage\n\n### Import and Create Cache\n\n```typescript\nimport { Cache } from '@ebenezerdon/ts-node-cache'\nconst cache = new Cache()\n```\n\n### Store Data\n\n```typescript\ncache.put('myKey', 'myValue', 5000, () =\u003e console.log('Expired'))\n```\n\n### Retrieve Data\n\n```typescript\nlet value = cache.get('myKey')\n```\n\n### Delete Data\n\n```typescript\ncache.del('myKey')\n```\n\n### Clear Cache\n\n```typescript\ncache.clear()\n```\n\n### Enable Debugging\n\n```typescript\ncache.debug(true)\n```\n\n## Methods\n\n- `put(key: string, value: T, time?: number, timeoutCallback?: (key: string, value: T) =\u003e void): T`\n- `get(key: string): T | null`\n- `del(key: string): boolean`\n- `clear(): void`\n- `size(): number`\n- `debug(bool: boolean): void`\n- `hits(): number`\n- `misses(): number`\n- `keys(): string[]`\n- `exportJson(): string`\n- `importJson(jsonToImport: string, options?: { skipDuplicates?: boolean }): number`\n\n## Contributing\n\nTo contribute:\n\n1. **Fork \u0026 Clone**: Fork the repo and clone it locally.\n2. **Make Changes**: Work on your changes.\n3. **Build**: Run `npm run build` to build the project.\n4. **Test**: Ensure your changes don't break anything.\n5. **Submit a PR**: Push your changes and submit a pull request.\n\n## License\n\nThis project is licensed under the ISC License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febenezerdon%2Fts-node-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febenezerdon%2Fts-node-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febenezerdon%2Fts-node-cache/lists"}