{"id":21009006,"url":"https://github.com/avin/static-hash-version","last_synced_at":"2026-04-27T06:35:32.737Z","repository":{"id":57370086,"uuid":"365747235","full_name":"avin/static-hash-version","owner":"avin","description":"Adds a prefix to links to statics containing the hash of the specified local files","archived":false,"fork":false,"pushed_at":"2021-05-09T12:30:54.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-21T14:10:54.827Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-09T12:27:31.000Z","updated_at":"2021-05-09T12:30:56.000Z","dependencies_parsed_at":"2022-09-16T22:51:17.767Z","dependency_job_id":null,"html_url":"https://github.com/avin/static-hash-version","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/avin/static-hash-version","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fstatic-hash-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fstatic-hash-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fstatic-hash-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fstatic-hash-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avin","download_url":"https://codeload.github.com/avin/static-hash-version/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fstatic-hash-version/sbom","scorecard":{"id":218251,"data":{"date":"2025-08-11","repo":{"name":"github.com/avin/static-hash-version","commit":"54ce77522804692eeb121d09b6b63abacf1a3d99"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/2 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-q8pj-2vqx-8ggc","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T02:02:40.579Z","repository_id":57370086,"created_at":"2025-08-17T02:02:40.579Z","updated_at":"2025-08-17T02:02:40.579Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32326112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-19T09:15:10.189Z","updated_at":"2026-04-27T06:35:27.727Z","avatar_url":"https://github.com/avin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Static-hash-version\n\nAdds a prefix to links to statics containing the hash of the specified local files.\n\nBefore:\n\n```html\n\u003cscript src=\"assets/script.js\"\u003e\u003c/script\u003e\n```\n\nAfter (with hash version prefix):\n\n```html\n\u003cscript src=\"assets/script.js?v=d1f7cc0bd0\"\u003e\u003c/script\u003e\n```\n\nAfter (with integrity attribute):\n\n```html\n\u003cscript\n  src=\"assets/script.js\"\n  integrity=\"sha384-JEnTFJ+xD2h3lK6x+XlNmwfcn1hXQ0Ocp9IznvK/daQZ6OiHpYYu+r5yR0bCmug8\"\n  crossorigin=\"anonymous\"\n\u003e\u003c/script\u003e\n```\n\n## Usage\n\nInstall:\n\n```sh\nnpm install static-hash-version\n```\n\nSimple usage:\n\n```js\nconst staticHashVersion = require(\"static-hash-version\");\n\nconst result = staticHashVersion({\n  htmlFilePath: \"./static/index.html\",\n});\n\nconsole.log(result);\n```\n\nComplex usage:\n\n```js\nconst staticHashVersion = require(\"static-hash-version\");\n\nstaticHashVersion({\n  htmlFilePath: \"./static/index.html\",\n  writeToFile: true,\n  tags: [\n    {\n      tagSelector: \"script\",\n      fileAttr: \"src\",\n      withIntegrity: false,\n      withVersion: true,\n    },\n    {\n      tagSelector: 'link[rel=\"stylesheet\"]',\n      fileAttr: \"href\",\n      withIntegrity: false,\n      withVersion: true,\n    },\n  ],\n  onFileAbsence: (filePath) =\u003e {\n    console.warn(`File ${filePath} is absent`);\n  },\n});\n```\n\n## Options\n\n### htmlFilePath\n\n- Required: **yes**\n- Type: `string`\n- Default value:\n- Description: File path for processing html file\n\n### writeToFile\n\n- Required: no\n- Type: `boolean`\n- Default value: `false`\n- Description: Write result to processing html file\n\n### onFileAbsence\n\n- Required: no\n- Type: `(filePath: string) =\u003e void`\n- Default value: `(v: string) =\u003e {}`\n- Description: Function called when the file specified in the tag is not found on disk\n\n### tags\n\n- Required: no\n- Type:\n\n  ```js\n  {\n    tagSelector: string;\n    fileAttr: string;\n    withIntegrity: boolean;\n    withVersion: boolean;\n  }\n  [];\n  ```\n\n- Default value:\n\n  ```js\n  [\n    {\n      tagSelector: \"script\",\n      fileAttr: \"src\",\n      withIntegrity: false,\n      withVersion: true,\n    },\n    {\n      tagSelector: 'link[rel=\"stylesheet\"]',\n      fileAttr: \"href\",\n      withIntegrity: false,\n      withVersion: true,\n    },\n  ];\n  ```\n\n- Description: Processing tags\n\n#### Tags item options\n\n##### tagSelector\n\n- Type: `string`\n- Description: Selector for tag\n\n##### fileAttr\n\n- Type: `string`\n- Description: Tag attribute containing a link to the file\n\n##### withIntegrity\n\n- Type: `boolean`\n- Description: Add integrity-attribute\n\n##### withVersion\n\n- Type: `boolean`\n- Description: Add hash suffix for file path `?v=XXXXX`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favin%2Fstatic-hash-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favin%2Fstatic-hash-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favin%2Fstatic-hash-version/lists"}