terminus makes it easier to create streams2 Writable streams. You can either use it like through2 to eliminate subclassing boilerplate, or use one of the provided helper terminus streams.
Create a streams.Writable instance that will call _writeFunction on every chunk. Consult the stream.Writable documentation for instructions on creating a _write function.
terminus.ctor([options,] _writeFunction)
Create a streams.Writable Subclass that can be used to re-create stream.Writable instances with the same _writeFunction.
terminus.devnull([options])
Create a stream.Writable instance that is akin to writing to dev/null i.e. it doesn't do anything except give your stream somewhere to go.
Why? Because if your pipeline doesn't terminate on a Writable stream, it will get paused at the High Water Mark with nothing to unpause it. I've most often seen this when people are using PassThrough streams, or Transforms that incorporate all required behavior.
terminus.concat([options], fn)
Collect the entire stream and when it is done, call fn(contents). This is similar to the stream behavior of concat-stream without the extra Array/Buffer concat behavior and entirely in streams2.
terminus.tail([options], fn)
A slightly less complicated version of terminus([options,] _writeFunction) that only requries you to provide a function that operates as fn(chunk, encoding).
options
All functions accept standard streams.Writable options, that is:
highWaterMark [Number] Buffer level when write() starts returning false. Default=16kb
decodeStrings [Boolean] Whether not to decode strings into Buffers before passing them to _write() Default=true
objectMode [Boolean] If the content is Javascript objects versus strings/buffers. Default=false
objectMode
The most common option you'll be setting is objectMode which will enable you to stream Javascript objects, e.g. records. Unfortunately this is currently required and ALL streams2 parts of your stream pipeline must be in objectMode or you'll get errors. It's annoying, I know.