Arcjet utilities for getting the body from a Node.js Stream.
Installation
npm install -S @arcjet/body
Example
import { readBody } from"../index";
// Some stream.Readable-like object, such as node's `http.IncomingMessage`const request = newIncomingMessage();
// Returns the body as a utf-8 encoded stringconst body = awaitreadBody(request, { limit: 1024 });
console.log(body);
Implementation
The implementation of this library is based on the raw-body
package. Licensed MIT with licenses included in our source code.
We've chosen to re-implement the logic to read the body from the stream to keep
the dependency tree for our packages as light as possible. Our implementation only
provides the functionality that we need, specifically it excludes the functionality
to return the stream as a buffer and always parses it as a utf-8 string. The interface
was also changed to only support promises rather than the sync implementation provided by raw-body.
Rework bot detection rule with allow/deny configuration (#1437)
🚀 New Features
Rework bot detection rule with allow/deny configuration (#1437) (eef18e3)
🧹 Miscellaneous Chores
examples: Correct some usage mistakes in sensitive info examples (#1503) (1286280)
FAQs
Arcjet utilities for extracting the body from a Node.js IncomingMessage
The npm package @arcjet/body receives a total of 238 weekly downloads. As such, @arcjet/body popularity was classified as not popular.
We found that @arcjet/body demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 0 open source maintainers collaborating on the project.
Package last updated on 05 Sep 2024
Did you know?
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.
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.