{"id":15437114,"url":"https://github.com/awwright/node-http-transform","last_synced_at":"2026-04-13T21:32:16.696Z","repository":{"id":57268410,"uuid":"151867120","full_name":"awwright/node-http-transform","owner":"awwright","description":"Node.js Transform stream with HTTP support","archived":false,"fork":false,"pushed_at":"2020-07-27T20:52:10.000Z","size":214,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T05:46:05.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awwright.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":"2018-10-06T17:57:11.000Z","updated_at":"2020-07-27T20:19:19.000Z","dependencies_parsed_at":"2022-09-02T03:40:22.088Z","dependency_job_id":null,"html_url":"https://github.com/awwright/node-http-transform","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/awwright/node-http-transform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Fnode-http-transform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Fnode-http-transform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Fnode-http-transform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Fnode-http-transform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awwright","download_url":"https://codeload.github.com/awwright/node-http-transform/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Fnode-http-transform/sbom","scorecard":{"id":219717,"data":{"date":"2025-08-11","repo":{"name":"github.com/awwright/node-http-transform","commit":"a1c785cfdb93b44ae039030d726264c433fb18f0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: UNLICENSE:0","Info: FSF or OSI recognized license: The Unlicense: UNLICENSE:0"],"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":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"}}]},"last_synced_at":"2025-08-17T02:14:31.460Z","repository_id":57268410,"created_at":"2025-08-17T02:14:31.460Z","updated_at":"2025-08-17T02:14:31.460Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31771823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-10-01T18:55:12.501Z","updated_at":"2026-04-13T21:32:16.677Z","avatar_url":"https://github.com/awwright.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http-transform\n\nAn extension of the Node.js Transform stream that additionally supports the HTTP header interface.\n\n* `RequestPair`: creates a pair of related streams, one writable, one readable; anything written to the `clientWritableSide` is readable on the `serverReadableSide`.\n* `ResponsePair`:  creates a pair of related streams, one writable, one readable; anything written to the `serverWritableSide` is readable on the `clientReadableSide`.\n* `ResponsePassThrough`: creates a Duplex stream that also stores HTTP headers; anything written to it becomes readable. Headers are passed through as exactly as possible. It should typically possible to pipe a response through a ResponsePassThrough instance with no change in behavior. This is typically used to programmatically create a response that's readable the same way a Node.js `req` object is, and can be piped to a `res` server response object.\n\n\n## TODO\n\n* `RequestPassThrough` — Request variation of `ResponsePassThrough`\n* `RequestThroughOrigin` — subclass of RequestPair that applies header normalizations, as if the request is actually going through the network.\n* `ResponseThroughOrigin` — subclass of ResponsePair that applies header normalizations, as if the response is actually going through the network.\n\n\n## Features\n\nMock a readable response object:\n\n```javascript\nfunction makeResponse(){\n\tconst res = new ResponsePassThrough;\n\tres.setHeader('Content-Type', 'text/plain')\n\tres.write('Line\\r\\n');\n\treturn res.readableClientSide;\n}\n```\n\nAdd a Content-Type to a ReadableStream:\n\n```javascript\nconst http = require('http');\nconst { createReadStream } = require('fs');\nconst { inherits } = require('util');\nconst { ResponseTransform } = require('.');\nconst { markdown } = require( \"markdown\" );\n\nclass MarkdownTransform extends ResponseTransform {\n\tconstructor() {\n\t\tsuper();\n\t\tconst [ input, output ] = this.makeStreams();\n\t\toutput.setHeader('Content-Type', 'application/xhtml+xml');\n\t\toutput.write('\u003c!DOCTYPE html\u003e');\n\t\toutput.write('\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" dir=\"ltr\"\u003e');\n\t\toutput.write('\t\u003chead\u003e');\n\t\toutput.write('\t\t\u003cmeta charset=\"UTF-8\" /\u003e');\n\t\toutput.write('\t\t\u003ctitle\u003e\u003c/title\u003e');\n\t\toutput.write('\t\t\u003cmeta name=\"description\" content=\"\" /\u003e');\n\t\toutput.write('\t\u003c/head\u003e');\n\t\toutput.write('\t\u003cbody\u003e');\n\t\toutput.write('\t\t\u003cmain id=\"main-content\"\u003e');\n\t\tinput.once('readable', async function(){\n\t\t\tvar source = '';\n\t\t\tfor await(var chunk of input) source += chunk.toString();\n\t\t\toutput.write(markdown.toHTML(this.sourceContents));\n\t\t\toutput.write('\t\t\u003c/main\u003e');\n\t\t\toutput.write('\t\u003c/body\u003e');\n\t\t\toutput.write('\u003c/html\u003e');\n\t\t\toutput.end();\n\t\t});\n\t}\n};\n\nconst server = http.createServer(function(req, res) {\n\tif(req.url!=='/'){\n\t\tres.statusCode = 404;\n\t\tres.end('404 Not Found\\n');\n\t\treturn;\n\t}\n\tif(req.method!=='GET'){\n\t\tres.statusCode = 501;\n\t\tres.setHeader('Allow', 'GET');\n\t\tres.end('501 Not Implemented\\n');\n\t\treturn;\n\t}\n\tcreateReadStream('README.md').pipe(new MarkdownTransform).pipe(res);\n});\nserver.listen(8080);\n```\n\n## API\n\n### ResponseTransform\n\nA subclass of the Node.js Transform that also transforms HTTP headers and status code.\n\nProperties/methods:\n\n* headersReady - A promise that resolves when headers have been committed and are ready to be read\n\n### PassThrough\n\nAccepts input and passes it to the write target(s).\n\nThis can be used to convert a typical ReadableStream into one that produces HTTP headers.\n\n### Headers\n\nHeaders is a simple container for HTTP headers. Its methods and properties are imported into ServerResponseTransform.\n\nProperties/methods, as implemented in Node.js:\n\n* statusCode\n* statusMessage\n* getHeader(name)\n* setHeader(name, value)\n* removeHeader(name)\n* getHeaderNames()\n* getHeaders()\n* hasHeader(name)\n* pipe(dst)\n\nAdditional methods:\n\n* addHeader(name, value)\n* pipeHeaders(dst) - copy status/message fields to `dst`\n* pipeMessage(dst) - copy status, message fields, and pipe the stream to `dst`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawwright%2Fnode-http-transform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawwright%2Fnode-http-transform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawwright%2Fnode-http-transform/lists"}