← All repos

raw-body

Get and validate the raw body of a readable stream

bodybundenohttpjavascriptnodejsparserstreamwebstreams
Browse cluster: Node.js HTTP utilities & middleware
570commits
19contributors
2languages

Tech stack & purpose

raw-body is a Node.js module that extracts and validates the complete buffer of a readable stream, returning it as either a Buffer or string. It is designed for parsing request bodies in HTTP applications and validates the stream's length against expected values and maximum size limits. The package provides two functions: `getRawBody` for Node.js readable streams and `getRawBodyWeb` for WHATWG ReadableStream objects, supporting various encoding options and custom decoders. It is written in JavaScript and distributed through npm.

Languages

TypeScript
99.9%
JavaScript
0.1%

Contributors