Skip to content

Commit

Permalink
updated the readme with non-node usage and an example
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Dec 22, 2010
1 parent cc33f06 commit 57273ea
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ You can also use forever from inside your own node.js code.
<pre>
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: []
Expand All @@ -71,6 +71,18 @@ You can also use forever from inside your own node.js code.
child.start();
</pre>

### 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:

<pre>
var forever = require('forever');
var child = forever.start([ 'perl', '-le', 'print "moo"' ], {
max : 1,
silent : true
});
</pre>

### Options available when using Forever in node.js
There are several options that you should be aware of when using forever:

Expand All @@ -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
}
</pre>

Expand Down Expand Up @@ -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
[1]: https://github.com/indexzero/forever/blob/master/bin/forever

0 comments on commit 57273ea

Please sign in to comment.