From 57273ea5485093612107fcfe63a618fc5b7751d2 Mon Sep 17 00:00:00 2001 From: James Halliday Date: Wed, 22 Dec 2010 08:30:56 +0000 Subject: [PATCH] updated the readme with non-node usage and an example --- README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 92b6fde9..116f3480 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ You can also use forever from inside your own node.js code.
   var forever = require('forever');
   
-  var child = new (forever.Forever)('your-filename.js'), {
+  var child = new (forever.Forever)('your-filename.js', {
     max: 3,
     silent: true,
     options: []
@@ -71,6 +71,18 @@ You can also use forever from inside your own node.js code.
   child.start();
 
+### Spawning a non-node process +You can spawn non-node processes too. Either set the `command` key in the +`options` hash or pass in an `Array` in place of the `file` argument like this: + +
+  var forever = require('forever');
+  var child = forever.start([ 'perl', '-le', 'print "moo"' ], {
+    max : 1,
+    silent : true
+  });
+
+ ### Options available when using Forever in node.js There are several options that you should be aware of when using forever: @@ -83,6 +95,8 @@ There are several options that you should be aware of when using forever: 'pidFile': 'path/to/file', // Path to put pid information for the process(es) started 'outFile': 'path/to/file', // Path to log output from child stdout 'errFile': 'path/to/file', // Path to log output from child stderr + 'command': 'perl', // Binary to run (default: 'node') + 'options': ['foo','bar'], // Additional arguments to pass to the script } @@ -127,4 +141,4 @@ The test coverage for 0.3.0 is currently lacking, but will be improved in 0.3.1. #### Contributors: [Fedor Indutny](http://github.com/donnerjack13589) [0]: http://nodejitsu.com -[1]: https://github.com/indexzero/forever/blob/master/bin/forever \ No newline at end of file +[1]: https://github.com/indexzero/forever/blob/master/bin/forever