MCPcopy
hub / github.com/Unitech/pm2 / start

Function start

lib/API/Modules/NPM.js:279–305  ·  view source on GitHub ↗
(PM2, modules, module_name, cb)

Source from the content-addressed store, hash-verified

277}
278
279function start(PM2, modules, module_name, cb) {
280 Common.printOut(cst.PREFIX_MSG_MOD + 'Starting NPM module ' + module_name);
281
282 var install_path = path.join(cst.DEFAULT_MODULE_PATH, module_name);
283 var proc_path = path.join(install_path, 'node_modules', module_name);
284 var package_json_path = path.join(proc_path, 'package.json');
285
286 var opts = {};
287
288 // Merge with embedded configuration inside module_conf (uid, gid)
289 Common.extend(opts, modules[module_name]);
290
291 // Merge meta data to start module properly
292 Common.extend(opts, {
293 // package.json path
294 cmd : package_json_path,
295 // starting mode
296 development_mode : false,
297 // process cwd
298 proc_path : proc_path
299 });
300
301 StartModule(PM2, opts, function(err, dt) {
302 if (err) console.error(err);
303 return cb();
304 })
305}
306
307function uninstall(CLI, module_name, cb) {
308 var module_name_only = Utility.getCanonicModuleName(module_name)

Callers

nothing calls this directly

Calls 2

StartModuleFunction · 0.85
cbFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…