Pipes.Node.Stream
- Package
- purescript-node-stream-pipes
- Repository
- cakekindel/purescript-node-stream-pipes
#fromReadable Source
fromReadable :: forall s a m. MonadThrow Error m => MonadAff m => Read s a => s -> Producer_ (Maybe a) m UnitConvert a Readable stream to a Pipe.
This will yield Nothing before exiting, signaling
End-of-stream.
#fromWritable Source
fromWritable :: forall s a m. MonadThrow Error m => MonadAff m => Write s a => s -> Consumer (Maybe a) m UnitConvert a Writable stream to a Pipe.
When Nothing is piped to this, the stream will
be ended, and the pipe will noop if invoked again.
#fromTransform Source
fromTransform :: forall a b m. MonadThrow Error m => MonadAff m => Transform a b -> Pipe (Maybe a) (Maybe b) m UnitConvert a Transform stream to a Pipe.
When Nothing is piped to this, the Transform stream will
be ended, and the pipe will noop if invoked again.
#inEOS Source
inEOS :: forall a b m. MonadRec m => Pipe a b m Unit -> Pipe (Maybe a) (Maybe b) m UnitLift a Pipe a a to Pipe (Maybe a) (Maybe a).
Allows easily using pipes not concerned with the EOS signal with pipes that do need this signal.
(ex. Pipes.Node.Buffer.toString doesn't need an EOS signal, but Pipes.Node.FS.create does.)
Just values will be passed to the pipe, and the response(s) will be wrapped in Just.
Nothing will bypass the given pipe entirely, and the pipe will not be invoked again.