Socket
Socket
Sign inDemoInstall

@aws-sdk/util-stream-node

Package Overview
Dependencies
Maintainers
5
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/util-stream-node

[![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


Version published
Weekly downloads
483K
decreased by-14.23%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/util-stream-node?

@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.

What are @aws-sdk/util-stream-node's main functionalities?

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
});

Other packages similar to @aws-sdk/util-stream-node

FAQs

Package last updated on 23 May 2023

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