Comparing version 5.3.1 to 5.4.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17432
793261
124
253
+ Addedjs-yaml@~4.1.0
+ Added@pm2/io@6.0.1(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedjs-yaml@4.1.0(transitive)
- Removedyamljs@0.3.0
- Removed@opencensus/core@0.0.80.0.9(transitive)
- Removed@opencensus/propagation-b3@0.0.8(transitive)
- Removed@pm2/io@5.0.2(transitive)
- Removedargparse@1.0.10(transitive)
- Removedasync-listener@0.6.10(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcontinuation-local-storage@3.2.1(transitive)
- Removedemitter-listener@1.1.2(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedlog-driver@1.2.7(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removeduuid@3.4.0(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedyamljs@0.3.0(transitive)
Updated@pm2/io@~6.0.0