{"id":15497407,"url":"https://github.com/heapwolf/stream-response","last_synced_at":"2026-03-12T03:32:52.207Z","repository":{"id":66203369,"uuid":"74969436","full_name":"heapwolf/stream-response","owner":"heapwolf","description":"Respond with `json`, `html`, `text`, or `redirect`. Extend headers easily.","archived":false,"fork":false,"pushed_at":"2017-09-05T13:27:36.000Z","size":8,"stargazers_count":9,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-18T14:49:17.419Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heapwolf.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-28T12:08:04.000Z","updated_at":"2018-09-25T02:33:35.000Z","dependencies_parsed_at":"2023-03-01T09:30:56.662Z","dependency_job_id":null,"html_url":"https://github.com/heapwolf/stream-response","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/heapwolf/stream-response","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fstream-response","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fstream-response/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fstream-response/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fstream-response/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heapwolf","download_url":"https://codeload.github.com/heapwolf/stream-response/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fstream-response/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30414324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T00:40:14.898Z","status":"online","status_checked_at":"2026-03-12T02:00:07.260Z","response_time":114,"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-10-02T08:33:29.433Z","updated_at":"2026-03-12T03:32:52.190Z","avatar_url":"https://github.com/heapwolf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYNOPSIS\nRespond with `json`, `html`, `text`, or `redirect`. Extend headers easily.\n\n# BUILD STATUS\n[![Build Status](https://travis-ci.org/0x00A/stream-response.svg?branch=master)](https://travis-ci.org/0x00A/stream-response)\n\n# USAGE\n```js\nconst Response = require('stream-response')\nconst http = require('http')\n\nhttp.createServer((req, res) =\u003e {\n  const response = Response(res)\n  response.json(200, { message: 'OK' })\n}).listen(8080)\n```\n\n```js\nresponse.html(401, '\u003ch1\u003eNot Allowed\u003c/h1\u003e')\n```\n\n```js\nresponse.text(418, 'Tea Time!')\n```\n\n## ABSOLUTE REDIRECTS\nDefaults to `302`.\n\n```js\nresponse.redirect(req, 'https://google.com')\nresponse.redirect(302, req, 'https://google.com')\n```\n\n## RELATIVE REDIRECTS\n```js\nresponse.redirect(req, '/login')\nresponse.redirect(301, req, '/login')\n```\n\n## EXTEND HEADERS\nExtend the headers for each request with the `headers()` method.\n\n```js\nresponse.headers({ 'content-type': 'application/x-www-form-urlencoded' })\nresponse.end(200, { name: 'danzig', number: 13 })\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fstream-response","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheapwolf%2Fstream-response","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fstream-response/lists"}