{"id":24014966,"url":"https://github.com/express-ts/cache","last_synced_at":"2025-10-20T03:33:02.382Z","repository":{"id":143755787,"uuid":"200529797","full_name":"express-ts/cache","owner":"express-ts","description":"A simple in-memory cache for @express.ts","archived":false,"fork":false,"pushed_at":"2019-08-04T18:52:03.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T22:47:08.985Z","etag":null,"topics":["cache","di","express-ts","inmemory-cache","typescript"],"latest_commit_sha":null,"homepage":"","language":null,"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/express-ts.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,"publiccode":null,"codemeta":null}},"created_at":"2019-08-04T18:49:24.000Z","updated_at":"2020-08-08T21:12:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"f88880d6-826c-4dd3-aa37-1e62fa5587ba","html_url":"https://github.com/express-ts/cache","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/express-ts%2Fcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express-ts%2Fcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express-ts%2Fcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express-ts%2Fcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/express-ts","download_url":"https://codeload.github.com/express-ts/cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240718991,"owners_count":19846485,"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","di","express-ts","inmemory-cache","typescript"],"created_at":"2025-01-08T07:38:21.864Z","updated_at":"2025-10-20T03:33:02.280Z","avatar_url":"https://github.com/express-ts.png","language":null,"readme":"# @express.ts/cache\n A simple in-memory cache for \u003ca href=\"https://github.com/express-ts/starter\"\u003e@express.ts\u003c/a\u003e\n\n### Installation\n\n    npm install @express.ts/cache --save\n\n### Usage\nTest.ts\n```typescript\nimport { Cache } from \"@express.ts/cache\";\n\nexport class Test {\n\n  protected value = Date.now();\n\n  getExecutionTime () {\n    return Date.now() - this.value;\n  }\n\n  @Cache(1000) // 1s\n  getExecutionTimeWithCache () {\n    return Date.now() - this.value;\n  }\n\n}\n```\nApp.ts\n```typescript\nimport { Test } from \"./Test\";\n\nconst testInstance = new Test();\n\nconsole.log([ // [ 4, 4 ]\n  testInstance.getExecutionTime(),\n  testInstance.getExecutionTimeWithCache()\n]);\n\nconsole.log([ // [ 24, 4 ]\n  testInstance.getExecutionTime(),\n  testInstance.getExecutionTimeWithCache()\n]);\n\nsetTimeout(() =\u003e {\n  console.log([ // [ 1038, 1038 ]\n    testInstance.getExecutionTime(),\n    testInstance.getExecutionTimeWithCache()\n  ]);\n}, 1001)\n\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpress-ts%2Fcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexpress-ts%2Fcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpress-ts%2Fcache/lists"}