{"id":13565321,"url":"https://github.com/stackhtml/hstream","last_synced_at":"2025-10-07T00:59:35.380Z","repository":{"id":51499333,"uuid":"118332271","full_name":"stackhtml/hstream","owner":"stackhtml","description":"streaming html templates","archived":false,"fork":false,"pushed_at":"2024-10-16T17:58:29.000Z","size":184,"stargazers_count":16,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-19T06:08:05.434Z","etag":null,"topics":["html","stream","template"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackhtml.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-21T12:21:42.000Z","updated_at":"2024-10-16T17:58:32.000Z","dependencies_parsed_at":"2024-10-28T03:23:30.901Z","dependency_job_id":"b46d2eb0-2de3-4179-adec-91d451006abf","html_url":"https://github.com/stackhtml/hstream","commit_stats":{"total_commits":58,"total_committers":2,"mean_commits":29.0,"dds":"0.12068965517241381","last_synced_commit":"a345fdb9c95ae495408c7fb417400aca256dd329"},"previous_names":["goto-bus-stop/hstream"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/stackhtml/hstream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhtml%2Fhstream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhtml%2Fhstream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhtml%2Fhstream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhtml%2Fhstream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackhtml","download_url":"https://codeload.github.com/stackhtml/hstream/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhtml%2Fhstream/sbom","scorecard":{"id":845407,"data":{"date":"2025-08-11","repo":{"name":"github.com/stackhtml/hstream","commit":"ab907eab52a988ad7b41224145dd679acccc72ae"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"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/30 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":"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/stackhtml/hstream/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/stackhtml/hstream/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/stackhtml/hstream/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/stackhtml/hstream/ci.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:33","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:48","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 npmCommand dependencies pinned"],"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T21:19:03.378Z","repository_id":51499333,"created_at":"2025-08-23T21:19:03.378Z","updated_at":"2025-08-23T21:19:03.378Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278703572,"owners_count":26031205,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"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":["html","stream","template"],"created_at":"2024-08-01T13:01:44.565Z","updated_at":"2025-10-07T00:59:35.352Z","avatar_url":"https://github.com/stackhtml.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# hstream\n\nstreaming html templates\n\nlike [hyperstream](https://github.com/substack/hyperstream), but faster. it does not support all hyperstream features.\n\ncurrently unsupported:\n\n - inserting text; only html is supported\n - prepending or appending to attributes\n\n[![npm][npm-image]][npm-url]\n[![actions][actions-image]][actions-url]\n[![standard][standard-image]][standard-url]\n\n[npm-image]: https://img.shields.io/npm/v/hstream.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/hstream\n[actions-image]: https://github.com/stackhtml/hstream/workflows/CI/badge.svg\n[actions-url]: https://github.com/stackhtml/hstream/actions?query=workflow%3ACI\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[standard-url]: http://npm.im/standard\n\n## Install\n\n```\nnpm install hstream\n```\n\n## Usage\n\n```js\nvar hstream = require('hstream')\n\nhstream({\n  'div \u003e .x[attr=\"value\"]': fs.createReadStream('./xyz.html')\n})\n```\n\n## API\n\n### `hstream(updates)`\n\nCreate a through stream that applies `updates`. `updates` is an object with CSS\nselectors for keys. Values can be different types depending on what sort of\nupdate you want to do.\n\nSelectors support the most common CSS features, like matching tag names,\nclasses, IDs, attributes. Pseudo selectors are not supported, but PRs are\nwelcome.\n\nPass a stream or string to replace the matching element's contents with some\nHTML. Pass an object to set attributes on the matching element or do some\nspecial operations. When passing an object, you can use keys prefixed with `_`\nfor the following special operations:\n\n - `_html` - Replace the matching element's contents with some HTML\n - `_prependHtml` - Prepend some HTML to the matching element\n - `_appendHtml` - Append some HTML to the matching element\n - `_replaceHtml` - Replace the entire element with some HTML\n\nAll properties accept streams and strings.\n\n`_html` and `_replaceHtml` can also be a function. Then they are called with\nthe html contents of the element being replaced, and should return a stream or\na string.\n\nWhen setting attributes, you can also use a function that receives the value of\nthe attribute as the only parameter and that returns a stream or string with\nthe new contents.\n\n```js\nhstream({\n  '#a': someReadableStream(), // replace content with a stream\n  '#b': 'a string value', // replace content with a string\n  // prepend and append some html\n  '#c': { _prependHtml: 'here comes the \u003cb\u003econtent\u003c/b\u003e: ', _appendHtml: ' …that\\'s all folks!' },\n  // replace content with a stream and set an attribute `attr=\"value\"`\n  '#d': { _html: someReadableStream(), 'attr': 'value' },\n  // set an attribute `data-whatever` to a streamed value\n  '#e': { 'data-whatever': someReadableStream() },\n  // replace an element with something that depends on the current value\n  '#f': { _html: function (input) { return input.toUpperCase() } },\n  // replace an attribute with something that depends on its current value\n  '#g': { class: function (current) { return cx(current, 'other-class') } }\n})\n```\n\n## Benchmarks\n\nRun `npm run bench`.\n\nhstream:\n\n```\nNANOBENCH version 2\n\u003e /usr/bin/node bench/hstream.js\n\n# 10× single transform\nok ~233 ms (0 s + 232898600 ns)\n\n# many transforms\nok ~159 ms (0 s + 158674007 ns)\n\n# small file\nok ~11 ms (0 s + 11377188 ns)\n\nall benchmarks completed\nok ~403 ms (0 s + 402949795 ns)\n```\n\nhyperstream:\n\n```\nNANOBENCH version 2\n\u003e /usr/bin/node bench/hyperstream.js\n\n# 10× single transform\nok ~1.84 s (1 s + 841403862 ns)\n\n# many transforms\nok ~1.69 s (1 s + 694201406 ns)\n\n# small file\nok ~101 ms (0 s + 101124108 ns)\n\nall benchmarks completed\nok ~3.64 s (3 s + 636729376 ns)\n```\n\n## License\n\n[Apache-2.0](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackhtml%2Fhstream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackhtml%2Fhstream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackhtml%2Fhstream/lists"}