Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@body/stream

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@body/stream

Gives a stream of an incoming http request, optionally with content decoded in respect to the `Content-Encoding` header.

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
increased by40.91%
Maintainers
1
Weekly downloads
 
Created
Source

Stream body parser

Gives a stream of an incoming http request, optionally with content decoded in respect to the Content-Encoding header.

Installation

npm install --save @body/stream

Usage

const getBodyStream = require('@body/stream')

// ...

app.post('/v1/users', (req, res, next) => {
  const body = getBodyStream(req)

  body.pipe(/* ... */)
})

// ...

API

getBodyStream(req: Request, options?: Options): ReadableStream

Read the body of the incoming request req. Returns a readable stream of the data.

If the body isn't encoded, the incoming request req will be returned as is.

Options
inflate (boolean)

When set to true, then bodies with a deflate or gzip content-encoding will be inflated.

Defaults to false.

FAQs

Package last updated on 21 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc