Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@aws-sdk/util-stream-node
Advanced tools
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-stream-node/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-stream-node) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-stream-node.svg)](https://www.npmjs.com/package/@aws
@aws-sdk/util-stream-node is a utility package from the AWS SDK for JavaScript that provides functions to work with Node.js streams. It is particularly useful for handling streaming data in AWS services.
streamToBuffer
Converts a readable stream into a buffer. This is useful when you need to process the entire content of a stream as a single buffer.
const { streamToBuffer } = require('@aws-sdk/util-stream-node');
const { Readable } = require('stream');
const readableStream = Readable.from(['Hello', ' ', 'World']);
streamToBuffer(readableStream).then(buffer => {
console.log(buffer.toString()); // Output: Hello World
});
streamToString
Converts a readable stream into a string. This is useful when you need to process the entire content of a stream as a single string.
const { streamToString } = require('@aws-sdk/util-stream-node');
const { Readable } = require('stream');
const readableStream = Readable.from(['Hello', ' ', 'World']);
streamToString(readableStream).then(string => {
console.log(string); // Output: Hello World
});
bufferToStream
Converts a buffer into a readable stream. This is useful when you need to process a buffer as a stream.
const { bufferToStream } = require('@aws-sdk/util-stream-node');
const buffer = Buffer.from('Hello World');
const stream = bufferToStream(buffer);
stream.on('data', chunk => {
console.log(chunk.toString()); // Output: Hello World
});
The 'stream-to-buffer' package provides a simple utility to convert a stream into a buffer. It is similar to the 'streamToBuffer' function in @aws-sdk/util-stream-node but is a standalone package.
The 'stream-to-string' package provides a utility to convert a stream into a string. It is similar to the 'streamToString' function in @aws-sdk/util-stream-node but is a standalone package.
The 'buffer-to-stream' package provides a utility to convert a buffer into a stream. It is similar to the 'bufferToStream' function in @aws-sdk/util-stream-node but is a standalone package.
Package with utilities to operate on Node.JS streams.
An internal package
You probably shouldn't, at least directly.
3.348.0 (2023-06-07)
FAQs
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-stream-node/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-stream-node) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-stream-node.svg)](https://www.npmjs.com/package/@aws
We found that @aws-sdk/util-stream-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.