Skip to content

Instantly share code, notes, and snippets.

@gavinengel
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gavinengel/98c069197baf6a55dd2b to your computer and use it in GitHub Desktop.
Save gavinengel/98c069197baf6a55dd2b to your computer and use it in GitHub Desktop.
daemonic: wrapper stub for turning a normall shell command into a node.js daemon
#!/usr/bin/env node
// source: https://gist.github.com/gavinengel/98c069197baf6a55dd2b
// example usage: $ pm2 start jade-watch.js;
var shelld = 'jade -w index.jade' // EDIT ONLY THIS LINE
var terminal = require('oh-my-terminal')
terminal.exec(shelld, function(err, stdout, stderr) {
if(err) console.log(err)
else console.log(stdout) + console.log(stderr) ;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment