Comparing version
@@ -325,3 +325,3 @@ /** | ||
var that = this; | ||
if (util.isArray(opts.watch) && opts.watch.length === 0) | ||
if (Array.isArray(opts.watch) && opts.watch.length === 0) | ||
opts.watch = (opts.rawArgs ? !!~opts.rawArgs.indexOf('--watch') : !!~process.argv.indexOf('--watch')) || false; | ||
@@ -1615,3 +1615,3 @@ | ||
if (util.isArray(appConf.watch) && appConf.watch.length === 0) { | ||
if (Array.isArray(appConf.watch) && appConf.watch.length === 0) { | ||
if (!~opts.rawArgs.indexOf('--watch')) | ||
@@ -1635,2 +1635,4 @@ delete appConf.watch | ||
delete appConf.automation; | ||
if (appConf.autostart === true) | ||
delete appConf.autostart; | ||
if (appConf.autorestart === true) | ||
@@ -1637,0 +1639,0 @@ delete appConf.autorestart; |
@@ -190,2 +190,8 @@ { | ||
}, | ||
"autostart": { | ||
"type": "boolean", | ||
"default": true, | ||
"docDefault": "True", | ||
"docDescription": "Enable or disable auto start when adding process" | ||
}, | ||
"autorestart": { | ||
@@ -192,0 +198,0 @@ "type": "boolean", |
@@ -79,2 +79,3 @@ 'use strict'; | ||
.option('--no-vizion', 'start an app without vizion feature (versioning control)') | ||
.option('--no-autostart', 'add an app without automatic start') | ||
.option('--no-autorestart', 'start an app without automatic restart') | ||
@@ -81,0 +82,0 @@ .option('--stop-exit-codes <exit_codes...>', 'specify a list of exit codes that should skip automatic restart') |
@@ -68,2 +68,3 @@ | ||
opts.watch = true; | ||
opts.autostart = true; | ||
opts.autorestart = true; | ||
@@ -70,0 +71,0 @@ opts.restart_delay = 1000 |
@@ -20,2 +20,3 @@ 'use strict'; | ||
.option('--secret [key]', '[MONITORING] PM2 plus secret key') | ||
.option('--no-autostart', 'add an app without automatic start') | ||
.option('--no-autorestart', 'start an app without automatic restart') | ||
@@ -22,0 +23,0 @@ .option('--stop-exit-codes <exit_codes...>', 'specify a list of exit codes that should skip automatic restart') |
@@ -307,3 +307,3 @@ /** | ||
Common.parseConfig = function(confObj, filename) { | ||
var yamljs = require('yamljs'); | ||
var yamljs = require('js-yaml'); | ||
var vm = require('vm'); | ||
@@ -327,3 +327,3 @@ | ||
else if (isConfigFile == 'yaml') { | ||
return yamljs.parse(confObj.toString()); | ||
return yamljs.load(confObj.toString()); | ||
} | ||
@@ -570,3 +570,3 @@ else if (isConfigFile == 'js' || isConfigFile == 'mjs') { | ||
//Ignore PM2's set environment variables from the nested env | ||
var keysToIgnore = ['name', 'exec_mode', 'env', 'args', 'pm_cwd', 'exec_interpreter', 'pm_exec_path', 'node_args', 'pm_out_log_path', 'pm_err_log_path', 'pm_pid_path', 'pm_id', 'status', 'pm_uptime', 'created_at', 'windowsHide', 'username', 'merge_logs', 'kill_retry_time', 'prev_restart_delay', 'instance_var', 'unstable_restarts', 'restart_time', 'axm_actions', 'pmx_module', 'command', 'watch', 'filter_env', 'versioning', 'vizion_runing', 'MODULE_DEBUG', 'pmx', 'axm_options', 'created_at', 'watch', 'vizion', 'axm_dynamic', 'axm_monitor', 'instances', 'automation', 'autorestart', 'stop_exit_codes', 'unstable_restart', 'treekill', 'exit_code', 'vizion']; | ||
var keysToIgnore = ['name', 'exec_mode', 'env', 'args', 'pm_cwd', 'exec_interpreter', 'pm_exec_path', 'node_args', 'pm_out_log_path', 'pm_err_log_path', 'pm_pid_path', 'pm_id', 'status', 'pm_uptime', 'created_at', 'windowsHide', 'username', 'merge_logs', 'kill_retry_time', 'prev_restart_delay', 'instance_var', 'unstable_restarts', 'restart_time', 'axm_actions', 'pmx_module', 'command', 'watch', 'filter_env', 'versioning', 'vizion_runing', 'MODULE_DEBUG', 'pmx', 'axm_options', 'created_at', 'watch', 'vizion', 'axm_dynamic', 'axm_monitor', 'instances', 'automation', 'autostart', 'autorestart', 'stop_exit_codes', 'unstable_restart', 'treekill', 'exit_code', 'vizion']; | ||
@@ -573,0 +573,0 @@ var keys = Object.keys(add); |
@@ -171,3 +171,3 @@ /** | ||
env_copy['status'] = cst.LAUNCHING_STATUS; | ||
env_copy['status'] = env.autostart ? cst.LAUNCHING_STATUS : cst.STOPPED_STATUS; | ||
env_copy['pm_uptime'] = Date.now(); | ||
@@ -215,2 +215,8 @@ env_copy['axm_actions'] = []; | ||
if (env_copy['autostart'] === false) { | ||
var clu = {pm2_env: env_copy, process: {pid: 0}}; | ||
God.clusters_db[env_copy.pm_id] = clu; | ||
return cb(null, clu); | ||
} | ||
/** Callback when application is launched */ | ||
@@ -217,0 +223,0 @@ var readyCb = function ready(proc) { |
@@ -32,3 +32,3 @@ /** | ||
if(typeof watch == 'boolean' || util.isArray(watch) && watch.length === 0) | ||
if(typeof watch == 'boolean' || Array.isArray(watch) && watch.length === 0) | ||
watch = pm2_env.pm_cwd; | ||
@@ -35,0 +35,0 @@ |
{ | ||
"name": "pm2", | ||
"preferGlobal": true, | ||
"version": "5.3.1", | ||
"version": "5.4.0", | ||
"engines": { | ||
"node": ">=10.0.0" | ||
"node": ">=12.0.0" | ||
}, | ||
@@ -172,4 +172,4 @@ "directories": { | ||
"@pm2/agent": "~2.0.0", | ||
"@pm2/io": "~5.0.0", | ||
"@pm2/js-api": "~0.8.0", | ||
"@pm2/io": "~6.0.0", | ||
"@pm2/pm2-version-check": "latest", | ||
@@ -200,3 +200,3 @@ "async": "~3.2.0", | ||
"vizion": "~2.2.1", | ||
"yamljs": "0.3.0" | ||
"js-yaml": "~4.1.0" | ||
}, | ||
@@ -207,3 +207,3 @@ "optionalDependencies": { | ||
"devDependencies": { | ||
"mocha": "^9.1.3", | ||
"mocha": "^10.4.0", | ||
"should": "^13.2.3" | ||
@@ -210,0 +210,0 @@ }, |
@@ -24,6 +24,2 @@ <div align="center"> | ||
<a title="Donate" href="https://explorer.kaspa.org/addresses/kaspa:qr2gxmun87mc8wt8adegy6fulvpfdjgsa8zcdxyulvzzr2utra3jv4s8txkq9"> | ||
<img src="https://img.shields.io/badge/donation-kaspa-green" alt="Donate"/> | ||
</a> | ||
<a title="PM2 Downloads" href="https://npm-stat.com/charts.html?package=pm2&from=2018-01-01&to=2023-08-01"> | ||
@@ -30,0 +26,0 @@ <img src="https://img.shields.io/npm/dm/pm2" alt="Downloads per Month"/> |
@@ -309,2 +309,6 @@ // Type definitions for pm2 2.7.1 | ||
/** | ||
* Enable or disable auto start after process added (default: true). | ||
*/ | ||
autostart?: boolean; | ||
/** | ||
* Enable or disable auto restart after process failure (default: true). | ||
@@ -450,3 +454,3 @@ */ | ||
/** | ||
* (Default: false) If true is passed in, pm2 will reload it’s environment from process.env | ||
* (Default: false) If true is passed in, pm2 will reload it’s environment from process.env | ||
* before reloading your process. | ||
@@ -453,0 +457,0 @@ */ |
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
17438
0.11%793261
-0.3%124
-1.59%253
-1.56%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated