
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
stream-from-iterator
Advanced tools
Create streams from ECMAScript® 2015 Iterators.
npm install stream-from-iterator --save
import StreamFromIterator from 'stream-from-iterator';
function * strRange(start, end) {
for (var i = start; i <= end; i++) {
yield String(i);
}
}
new StreamFromIterator(strRange(0, 9))
.pipe(process.stdout); // output: 0123456789
String | Buffersimport StreamFromIterator from 'stream-from-iterator';
new StreamFromIterator(['some', ' ', 'strings'].values())
.pipe(process.stdout); // output: some strings
new StreamFromIterator([new Buffer('some'), ' mixed ', new Buffer('strings')].values())
.pipe(process.stdout); // output: some mixed strings
import StreamFromIterator from 'stream-from-iterator';
var i = 0;
StreamFromIterator.obj(['some', 42, 'mixed', 'array', () => {}].values())
.on('data', data => {
console.log(i++ + ': ' + typeof data);
/* outputs:
0: string
1: number
2: string
3: string
4: function
*/
});
StreamFromIterators are Readable streams.
Iterator ES2015 Iterator iterating over arbitrary Javascript values like numbers, strings, objects, functions, ...Object passed through new Readable([options])Note: The new operator can be omitted.
A convenience wrapper for new StreamFromIterator(iterator, {objectMode: true, ...}).
MIT © Michael Mayer
FAQs
Create streams from ES2015 iterators
We found that stream-from-iterator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.