Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50654 views
1
/*
2
* index.js: Top-level include for the `forever-monitor` module.
3
*
4
* (C) 2010 Nodejitsu Inc.
5
* MIT LICENCE
6
*
7
*/
8
9
var pkginfo = require('pkginfo'),
10
utile = require('utile'),
11
common = require('./forever-monitor/common');
12
13
exports.kill = common.kill;
14
exports.checkProcess = common.checkProcess;
15
exports.Monitor = require('./forever-monitor/monitor').Monitor;
16
17
//
18
// Expose version through `pkginfo`
19
//
20
require('pkginfo')(module, 'version');
21
22
//
23
// ### function start (script, options)
24
// #### @script {string} Location of the script to run.
25
// #### @options {Object} Configuration for forever instance.
26
// Starts a script with forever
27
//
28
exports.start = function (script, options) {
29
if (!options.uid) {
30
options.uid = options.uid || utile.randomString(4).replace(/^\-/, '_');
31
}
32
33
return new exports.Monitor(script, options).start();
34
};
35
36