Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 472 Bytes

README.md

File metadata and controls

14 lines (10 loc) · 472 Bytes

spawn-stream

Use a child process to transform a node-js stream.

var SpawnStream = require('spawn-stream');

var grepHello = SpawnStream('grep', ['hello'])
fs.createReadStream('input.txt')
    .pipe(grepHello).pipe(fs.createWriteStream('output.txt', 'w');

var ffmpeg = SpawnStream('ffmpeg', ['-i', '-', '-f', 'mp4', 'pipe:1']);
fs.createReadStream('input.ts')
    .pipe(ffmpeg).pipe(fs.createWriteStream('output.mp4', 'w');