Skip to content

Commit 1ecb0dd

Browse files
committed
Doc updates
1 parent f09301e commit 1ecb0dd

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

‎README.md‎

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ node-mac, prepare a script like:
2525
var svc = new Service({
2626
name:'Hello World',
2727
description: 'The nodejs.org example web server.',
28-
script: 'C:\\path\\to\\helloworld.js')
28+
script: '/path/to/helloworld.js')
2929
});
3030

3131
// Listen for the "install" event, which indicates the
@@ -65,7 +65,7 @@ Sometimes you may want to provide a service with static data, passed in on creat
6565
var svc = new Service({
6666
name:'Hello World',
6767
description: 'The nodejs.org example web server.',
68-
script: 'C:\\path\\to\\helloworld.js',
68+
script: '/path/to/helloworld.js',
6969
env: {
7070
name: "HOME",
7171
value: process.env["USERPROFILE"] // service is now able to access the user who created its' home directory
@@ -77,7 +77,7 @@ You can also supply an array to set multiple environment variables:
7777
var svc = new Service({
7878
name:'Hello World',
7979
description: 'The nodejs.org example web server.',
80-
script: 'C:\\path\\to\\helloworld.js',
80+
script: '/path/to/helloworld.js',
8181
env: [{
8282
name: "HOME",
8383
value: process.env["USERPROFILE"] // service is now able to access the user who created its' home directory
@@ -137,7 +137,7 @@ Both the initial wait time and the growth rate are configuration options that ca
137137
var svc = new Service({
138138
name:'Hello World',
139139
description: 'The nodejs.org example web server.',
140-
script: 'C:\\path\\to\\helloworld.js'),
140+
script: '/path/to/helloworld.js'),
141141
wait: 2,
142142
grow: .5
143143
});
@@ -148,12 +148,15 @@ would be 3 seconds later while the fourth would be 4.5 seconds later.
148148
**Don't DOS Yourself!**
149149

150150
Repetitive recycling could potentially go on forever with a bad script. To handle these situations, node-mac
151-
supports two kinds of caps. Using `maxRetries` will cap the maximum number of restart attempts. By
152-
default, this is unlimited. Setting it to 3 would tell the process to no longer restart a process
153-
after it has failed 3 times. Another option is `maxRestarts`, which caps the number of restarts attempted
154-
within 60 seconds. For example, if this is set to 3 (the default) and the process crashes/restarts repeatedly,
155-
node-mac will cease restart attempts after the 3rd cycle in a 60 second window. Both of these
156-
configuration options can be set, just like `wait` or `grow`.
151+
supports two kinds of caps. Using `maxRetries` will cap the maximum total number of times the service
152+
restarts itself before it kills the process. By default, this is unlimited. Setting it to 3 would tell the
153+
process to stop restarting itself (i.e. leave the dead process alone) after it tries to restart it 3 times.
154+
155+
Another option is `maxRestarts`, which caps the number of restarts attempted within a 60 second period.
156+
For example, if this is set to 3 (the default) and the process crashes/restarts repeatedly,
157+
node-mac will stop restarting the process after the 3rd crash within a 60 second timeframe.
158+
159+
Both of these configuration options can be set, just like `wait` or `grow`.
157160

158161
Finally, an attribute called `abortOnError` can be set to `true` if you want your script to **not** restart
159162
at all when it exits with an error.

‎lib/daemon.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ var daemon = function(config) {
259259
/**
260260
* @method install
261261
* Install the script as a background process/daemon.
262-
* @param {Function} callback
262+
* @param {Function} [callback]
263263
*/
264264
install: {
265265
enumerable: true,

0 commit comments

Comments
 (0)