UNPKG

highland-process

Version:

Utility that lets you turn a process into a highland stream.

29 lines (20 loc) 655 B
# Highland Process Turn a process into a highland stream or pipe through a process. ## Install npm install highland-process ## Usage var _ = require('highland'); var highlandProcess = require('highland-process'); var spawn = require('child_process').spawn; var tee = spawn('tee'); var ls = spawn('ls'); _(['hello how are you?']) .through(highlandProcess.through(tee)) .pull(function(error, value) { // value is a buffer with "hello how are you?" that has been piped through tee }); highlandProcess.from(ls) .split() .toArray(function(values) { // each line of output from ls });