Skip to content

Instantly share code, notes, and snippets.

@felixzapata
Created January 19, 2014 21:01
Show Gist options
  • Save felixzapata/8510944 to your computer and use it in GitHub Desktop.
Save felixzapata/8510944 to your computer and use it in GitHub Desktop.
Spawning a Child Process
'use strict';
const
fs = require('fs'),
spawn = require('child_process').spawn;
fs.watch(filename, function(){
let ls = spawn('ls', ['-lh', filename]);
ls.stdout.pipe(process.stdout);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment