block by joyrexus 9073081

Object stream mapper demo

Demonstrate how to extend stream‘s Transform base class to create streaming mappers for streamed objects.

inc = new Map((d) -> d + 1)   # increment each value by one

count
  .upto(3)
  .pipe(inc)
  .pipe(log)

Outputs 2, 3, 4

index.coffee