{"id":20792297,"url":"https://github.com/xtrm-en/lume-cache-assets","last_synced_at":"2025-06-25T14:33:49.746Z","repository":{"id":217036900,"uuid":"742977067","full_name":"xtrm-en/lume-cache-assets","owner":"xtrm-en","description":"@lumeland plugin that allows caching remote assets locally","archived":false,"fork":false,"pushed_at":"2024-01-14T17:55:12.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T20:27:06.379Z","etag":null,"topics":["deno","lume","lume-plugin"],"latest_commit_sha":null,"homepage":"","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/xtrm-en.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}},"created_at":"2024-01-13T23:33:57.000Z","updated_at":"2024-04-08T23:07:44.000Z","dependencies_parsed_at":"2024-01-14T07:44:52.789Z","dependency_job_id":"7ff59e86-2839-49cf-8e80-4ed555d6804c","html_url":"https://github.com/xtrm-en/lume-cache-assets","commit_stats":null,"previous_names":["xtrm-en/lume-cache-assets"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/xtrm-en/lume-cache-assets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtrm-en%2Flume-cache-assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtrm-en%2Flume-cache-assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtrm-en%2Flume-cache-assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtrm-en%2Flume-cache-assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtrm-en","download_url":"https://codeload.github.com/xtrm-en/lume-cache-assets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtrm-en%2Flume-cache-assets/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260802641,"owners_count":23065473,"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":["deno","lume","lume-plugin"],"created_at":"2024-11-17T15:49:58.208Z","updated_at":"2025-06-25T14:33:49.722Z","avatar_url":"https://github.com/xtrm-en.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lume-cache-assets\n\n[Lume](https://lume.land) plugin that allows caching remote assets locally.\n\n## Installation\n\nImport this plugin in your `_config.ts` file to use it:\n\n```ts\nimport lume from \"https://deno.land/x/lume/mod.ts\";\nimport cacheAssets from \"https://deno.land/x/lume_cache_assets@0.0.8/mod.ts\";\n\nconst site = lume();\n\nsite.use(cacheAssets(/* Options */));\n\nexport default site;\n```\n\n## Options\n\n```ts\ninterface Options {\n  /**\n   * The extensions of the files to process.\n   * @default [\".html\"]\n   */\n  extensions?: string[];\n\n  /**\n   * A function that returns true if the URL should be cached.\n   * @default (url: string) =\u003e url.startsWith(\"https://\") \u0026\u0026 [\".png\", \".jpg\", \".jpeg\", \".gif\", \".svg\", \".ico\", \".webp\"].some((ext) =\u003e url.endsWith(ext)),\n   */\n  shouldCache?: (url: string) =\u003e boolean;\n\n  /**\n   * Transforms the URL into a hashed version for local storage use.\n   * @param url The URL to transform.\n   * @returns A file-system-compatible string.\n   * @default (url: string) =\u003e sha1(url)\n   */\n  transform?: (url: string) =\u003e string;\n\n  /**\n   * The folder where the images will be cached.\n   * @default \"cache\"\n   */\n  folder?: string;\n\n  /**\n   * Whether to log the output or not.\n   * @default true\n   */\n  logOutput?: boolean;\n}\n```\n\n## Full example\n\n```ts\n\nimport lume from \"https://deno.land/x/lume/mod.ts\";\nimport cacheAssets from \"https://deno.land/x/lume_cache_assets@0.0.8/mod.ts\";\n\nimport md5 from 'npm:md5';\n\nconst site = lume();\n\nsite.use(cacheAssets({\n  extensions: [\".html\"],\n  shouldCache: (url: string) =\u003e url.startsWith(\"https://\") \u0026\u0026 url.endsWith(\".png\"),\n  transform: md5,\n  folder: \"assets/cache\",\n  logOutput: true,\n}));\n\nexport default site;\n```\n\n### wait what's `logOutput`?\n\nglad you asked.\n\n![demo](https://github.com/xtrm-en/lume-cache-assets/assets/26600206/7c4f862f-2761-4d3e-9d86-e6b3a11b6c8f)\n\n## License\n\nThis project is licensed under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtrm-en%2Flume-cache-assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtrm-en%2Flume-cache-assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtrm-en%2Flume-cache-assets/lists"}