A quick demo of through2-map
usage.
fs = require 'fs'
csv = require 'csv2'
map = require 'through2-map'
extract = map(objectMode: true, (row) -> row[1] + '\n')
fs.createReadStream('data.csv')
.pipe(csv())
.pipe(extract)
.pipe(process.stdout) # B, b1, b2, b3
{Readable} = require 'stream'
# a simple transform stream
tx = map((d) -> d.toString().toUpperCase())
# a simple source stream
rs = new Readable
rs.push 'the quick brown fox jumps over the lazy dog!\n'
rs.push null
rs.pipe(tx)
.pipe(process.stdout) # THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG!