{"id":15497383,"url":"https://github.com/heapwolf/stream-body","last_synced_at":"2025-03-18T03:28:50.413Z","repository":{"id":57371967,"uuid":"74897418","full_name":"heapwolf/stream-body","owner":"heapwolf","description":"parse a stream correctly (according to the content-type) using raw-body","archived":false,"fork":false,"pushed_at":"2018-01-25T14:38:00.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T19:48:43.975Z","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}},"created_at":"2016-11-27T15:48:24.000Z","updated_at":"2018-01-26T20:32:14.000Z","dependencies_parsed_at":"2022-08-30T16:42:07.116Z","dependency_job_id":null,"html_url":"https://github.com/heapwolf/stream-body","commit_stats":null,"previous_names":["0x00a/stream-body"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fstream-body","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fstream-body/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fstream-body/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fstream-body/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heapwolf","download_url":"https://codeload.github.com/heapwolf/stream-body/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244149322,"owners_count":20406354,"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":[],"created_at":"2024-10-02T08:33:17.718Z","updated_at":"2025-03-18T03:28:50.396Z","avatar_url":"https://github.com/heapwolf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYNOPSIS\nGet the complete body from a stream and parse it automatically.\n\n# MOTIVATION\nA minimal wrapper around [raw-body](https://github.com/stream-utils/raw-body)\nthat provides you with the correct parser.\n\n# BUILD STATUS\n[![Build Status](https://travis-ci.org/0x00A/stream-body.svg?branch=master)](https://travis-ci.org/0x00A/stream-body)\n\n# USAGE\nThis module detects the content type of the stream and parses it appropriately.\nSo for instance, if you request a resource with a `content-type` header which\nhas the value of `application/json`, the response body will be parsed as `JSON`.\n\n```js\nconst http = require('http')\nconst body = require('stream-body')\n\nconst url = 'http://nodejs.org/dist/index.json'\n\nhttp.get(url, res =\u003e body.parse(res, (err, data) =\u003e {\n\n  // ...`data` will be a json object.\n}))\n```\n\n# EXTENDING\nThis module exports an object that exposes all parsers. For instance, the `JSON`\nparser implemintation is defined on the `parsers` member...\n\n```js\nconst body = require('stream-body')\n\nbody.parsers['application/json'] = function (data, opts, cb) {\n\n  // `data` is the raw data object\n  // `opts` is any options passed in to the parse function\n  // `cb` is called after the stream has ended\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fstream-body","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheapwolf%2Fstream-body","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fstream-body/lists"}