{"id":18023990,"url":"https://github.com/lete114/cache-hash","last_synced_at":"2025-03-27T00:30:47.126Z","repository":{"id":50670762,"uuid":"519770364","full_name":"Lete114/cache-hash","owner":"Lete114","description":"Create hash for static resources to break http cache","archived":false,"fork":false,"pushed_at":"2023-11-03T11:42:48.000Z","size":123,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T18:11:18.011Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Lete114.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}},"created_at":"2022-07-31T12:29:53.000Z","updated_at":"2024-01-14T04:33:38.000Z","dependencies_parsed_at":"2023-02-08T17:15:31.321Z","dependency_job_id":"52854b78-35cd-469f-9876-ea003a9de414","html_url":"https://github.com/Lete114/cache-hash","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"404408a8817b97f082125779c37b343f5561b3b7"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2Fcache-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2Fcache-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2Fcache-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2Fcache-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lete114","download_url":"https://codeload.github.com/Lete114/cache-hash/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245760561,"owners_count":20667886,"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":[],"created_at":"2024-10-30T07:11:37.383Z","updated_at":"2025-03-27T00:30:46.786Z","avatar_url":"https://github.com/Lete114.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cache-hash\n\n![visitor](https://visitor_badge.deta.dev/?pageID=github.Lete114.cache-hash)\n![version](https://img.shields.io/npm/v/cache-hash?color=critical\u0026logo=npm)\n![license](https://img.shields.io/npm/l/cache-hash?color=ee5535)\n\n## Installation\n\n```bash\nnpm install cache-hash -D\n```\n\nOr global install\n\n```bash\nnpm install cache-hash -g\n```\n\n## Use CLI\n\n```bash\ncache-hash --target source --output public\n```\n\nOr\n\n```bash\ncache-hash -t source -o public\n```\n\nSee help `cache-hash --help` for more configuration\n\n```bash\n$ cache-hash --help\nUsage: cache-hash [options]\n\nOptions:\n  -v, --version          output the version number\n  -t, --target \u003ctarget\u003e  Target resource directory (default: \"./\")\n  -o, --output \u003coutput\u003e  Output directory, If not set, he will overwrite the \"target\" content\n  --size \u003csize\u003e          Generate hash length (default: 10)\n  --key \u003ckey\u003e            Version key (default: \"v\")\n  --lazy \u003clazy\u003e          Select the specified dom element. Example: `'[[\"a\",\"b\"]]'` selects the img tag, and the img tag must contain the lazy attribute (default: [['script', 'src'], ['link', 'href'], ['img', 'src']])\n  --html \u003chtml\u003e          Generate hash for html referenced resources (default: true)\n  --css \u003ccss\u003e            Generate hash for css referenced resources (default: true)\n  --js \u003cjs\u003e              Generate hash for js referenced resources (default: true)\n  --style \u003cstyle\u003e        Generating hashes for resources referenced by style tags (\u003cstyle\u003e) (default: true)\n  --script \u003cscript\u003e      Generating hashes for resources referenced by script tags (\u003cscript\u003e) (default: true)\n  --ignore \u003cignore...\u003e   Ignore the specified directory or file (default: [])\n  -h, --help             display help for command\n```\n\n## Use JavaScript API\n\n```js\nconst cacheHash = require('cache-hash')\n\ncacheHash({\n  target: 'source',\n  output: 'public'\n})\n\n// Please see the cli help parameter description above\n// defualtOptions: {\n//   target: process.cwd(), // Current command line path\n//   output: process.cwd(), // Current command line path\n//   size: 10,\n//   versionKey: 'v',\n//   selectAll: [ [ 'script', 'src' ], [ 'link', 'href' ], [ 'img', 'src' ] ],\n//   html: true,\n//   css: true,\n//   js: true,\n//   style: true,\n//   script: true,\n//   ignore: []\n// }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flete114%2Fcache-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flete114%2Fcache-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flete114%2Fcache-hash/lists"}