{"id":16791993,"url":"https://github.com/metonym/hash-static","last_synced_at":"2026-01-03T16:35:06.102Z","repository":{"id":35149261,"uuid":"213194009","full_name":"metonym/hash-static","owner":"metonym","description":"Utility to hash static assets","archived":false,"fork":false,"pushed_at":"2023-01-05T16:20:31.000Z","size":1758,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T00:45:35.441Z","etag":null,"topics":["cache","hash","posthtml","static-assets","utility"],"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/metonym.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":"2019-10-06T15:33:04.000Z","updated_at":"2022-01-15T05:35:12.000Z","dependencies_parsed_at":"2023-01-15T15:00:15.242Z","dependency_job_id":null,"html_url":"https://github.com/metonym/hash-static","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fhash-static","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fhash-static/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fhash-static/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fhash-static/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metonym","download_url":"https://codeload.github.com/metonym/hash-static/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960666,"owners_count":20375105,"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","hash","posthtml","static-assets","utility"],"created_at":"2024-10-13T08:43:47.520Z","updated_at":"2026-01-03T16:35:06.061Z","avatar_url":"https://github.com/metonym.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hash-static\n\n[![NPM][npm]][npm-url]\n[![Build][build]][build-badge]\n[![Coverage][codecov-shield]][codecov]\n\n\u003e Utility to hash static assets.\n\n`hash-static` provides a CLI to minify and hash static assets using [htmlnano](https://github.com/posthtml/htmlnano) and [posthtml-hash](https://github.com/posthtml/posthtml-hash).\n\n## Install\n\n```bash\nyarn add -D hash-static\n```\n\n## Usage\n\nThe entry must be an `index.html` file. The path is relative from the current directory.\n\n### CLI\n\n```bash\nyarn run hash-static 'dist/index.html'\n```\n\nYou can use the CLI as a postbuild script to `package.json`.\n\n```diff\n\"scripts\": {\n  \"build\": \"rollup -c\",\n+ \"postbuild\": \"hash-static dist/index.html\"\n}\n```\n\nThen, running `yarn build` will automatically run the `postbuild` script.\n\n### Node\n\n```js\nconst { hashStatic } = require('hash-static');\n\nhashStatic({ entry: 'dist/index.html' });\n```\n\n### Options\n\n| Name     | Kind                                   | Description                                                    |\n| -------- | -------------------------------------- | -------------------------------------------------------------- |\n| `entry`  | **required** `string`                  | Relative path from the current directory to entry `index.html` |\n| `minify` | optional `boolean` (default is `true`) | Minify `index.html` markup                                     |\n\n## [Changelog](CHANGELOG.md)\n\n## License\n\n[MIT](LICENSE)\n\n[npm]: https://img.shields.io/npm/v/hash-static.svg?color=blue\n[npm-url]: https://npmjs.com/package/hash-static\n[build]: https://travis-ci.com/metonym/hash-static.svg?branch=master\n[build-badge]: https://travis-ci.com/metonym/hash-static\n[codecov]: https://codecov.io/gh/metonym/hash-static\n[codecov-shield]: https://img.shields.io/codecov/c/github/metonym/hash-static.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetonym%2Fhash-static","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetonym%2Fhash-static","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetonym%2Fhash-static/lists"}