{"id":23196239,"url":"https://github.com/dalcib/deno-cache","last_synced_at":"2025-08-18T22:31:34.962Z","repository":{"id":57211900,"uuid":"305129753","full_name":"dalcib/deno-cache","owner":"dalcib","description":"A port of the cache module of Deno to be used with nodejs","archived":false,"fork":false,"pushed_at":"2020-12-13T14:33:32.000Z","size":28,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-14T10:10:08.842Z","etag":null,"topics":["cache","deno"],"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/dalcib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-10-18T15:12:37.000Z","updated_at":"2023-01-21T15:02:02.000Z","dependencies_parsed_at":"2022-09-08T18:11:22.279Z","dependency_job_id":null,"html_url":"https://github.com/dalcib/deno-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/dalcib%2Fdeno-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalcib%2Fdeno-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalcib%2Fdeno-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalcib%2Fdeno-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dalcib","download_url":"https://codeload.github.com/dalcib/deno-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230161604,"owners_count":18182902,"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","deno"],"created_at":"2024-12-18T14:17:28.484Z","updated_at":"2024-12-18T14:17:29.128Z","avatar_url":"https://github.com/dalcib.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno-cache\n\nThis npm package is a port of the [cache](https://deno.land/x/cache) module of Deno to be used with nodejs.\n\n\n\nCache library, compatible with deno [module caching](https://deno.land/manual/linking_to_external_code).\n\n```typescript\nimport {readFile} from 'fs/promises'\nimport  {cache} from \"deno-cache\";\n\nlet file = await cache(\"https://example.com/file.json\");\n\nconst text = await fs.readFile(file.path, 'utf8');\nconsole.log(text);\n```\n\nor\n\n\n```typescript\nimport {readFile} from 'fs/promises'\nimport  * as Cache from \"deno-cache\";\n\nconst url = 'https://example.com/file.js'\n\nCache.configure({\n  directory: 'cache',\n})\nconst deps = Cache.namespace('deps')\n\nconsole.log(await deps.exists(url)) //false\n\nconst file = await deps.cache(url)\n\nconsole.log(await deps.exists(url)) //true\n\nconsole.log(file)\n/* {\n  url: URL {...}\n  policy: undefined,\n  ns: 'deps',\n  hash: 'cdb5afb638e1edad8d0b947130a614930b0ec51ada5294dcedf120ad1518692f',\n  path: './cache/deps/https/example.com/cdb5afb638e1edad8d0b947130a614930b0ec51ada5294dcedf120ad1518692f',       \n  metapath: './cache/deps/https/example.com/cdb5afb638e1edad8d0b947130a614930b0ec51ada5294dcedf120ad1518692f.metadata.json',\n  origin: 'fetch'\n  lstat: Stats {...}\n}*/\n\nawait deps.remove(abs)\nconsole.log(await deps.exists(url)) //false\n```\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalcib%2Fdeno-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdalcib%2Fdeno-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalcib%2Fdeno-cache/lists"}