node-stream-spigot icon indicating copy to clipboard operation
node-stream-spigot copied to clipboard

You might not need stream spigot

Open legopin opened this issue 4 years ago • 1 comments

NodeJs 12.3 has added a new method that could replace stream-spigot. Maybe we can add it to the readme to bring awareness to it.

https://nodejs.org/docs/latest-v12.x/api/stream.html#stream_stream_readable_from_iterable_options

const { Readable } = require('stream');
const reader = Readable.from([{ name: 'apple' }, { name: 'berry' }], {
    objectMode: true,
  });

const stringReader = Readable.from(['hello', 'world', 'this','is','awesome']);

legopin avatar Jan 08 '21 03:01 legopin

since this haven't been updated in so long and still uses stream2 without iterators maybe this should be archived and make the npm package depricated?

jimmywarting avatar May 22 '21 17:05 jimmywarting