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

into-stream

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

into-stream

Convert a string/promise/array/iterable/buffer/typedarray/arraybuffer/object into a stream

  • 4.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.2M
decreased by-11.54%
Maintainers
1
Weekly downloads
 
Created

What is into-stream?

The into-stream npm package allows you to convert various data types into readable streams. This is particularly useful when you need to work with streams but your data is not already in a stream format.

What are into-stream's main functionalities?

Convert String to Stream

This feature allows you to convert a string into a readable stream. The example code converts the string 'Hello, world!' into a stream and pipes it to the standard output.

const intoStream = require('into-stream');
const stream = intoStream('Hello, world!');
stream.pipe(process.stdout);

Convert Buffer to Stream

This feature allows you to convert a Buffer into a readable stream. The example code converts a Buffer containing 'Hello, world!' into a stream and pipes it to the standard output.

const intoStream = require('into-stream');
const buffer = Buffer.from('Hello, world!');
const stream = intoStream(buffer);
stream.pipe(process.stdout);

Convert Array to Stream

This feature allows you to convert an array into a readable stream. The example code converts an array of strings into a stream and logs each chunk to the console.

const intoStream = require('into-stream');
const array = ['Hello', 'world', '!'];
const stream = intoStream(array);
stream.on('data', chunk => console.log(chunk.toString()));

Convert Object to Stream

This feature allows you to convert an object into a readable stream. The example code converts an object into a stream and logs each chunk to the console.

const intoStream = require('into-stream');
const object = { key: 'value' };
const stream = intoStream.object(object);
stream.on('data', chunk => console.log(chunk));

Other packages similar to into-stream

Keywords

FAQs

Package last updated on 12 Oct 2018

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