Node.js has a simple and powerful stream API. Streams in Node.js are unix pipes that let you perform asynchronous I/O operations by reading source data and pipe it to destination. If your application operates not with streams only, but promises, callbacks or synchronous code, you may want to use more deeper abstraction that fits your needs. In this case you may take a look at Highland.
Highland library allows you to manage asynchronous and synchronous code easily both in Node.js and in the browser. With Highland you can simple switch between synchronous and asynchronous data sources without re-writing your code. You can install Highland with NPM:
and require or import it as yet another Node.js module:
Converting from arrays to Highland Streams:
Map and reduce over a stream:
Reading files in parallel:
Pipe to Node.js streams:
If you need to handle your synchronous and asynchronous data with differrent abstractions in one way, operate with Node.js streams at higher level, you can use Highland high-level streams library to fit your needs. You can find more at Highland docs.