Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2020-11-11 02:40:30 +0300
committerisaacs <i@izs.me>2020-11-13 22:22:56 +0300
commitfd1d7a21b247bb35d112c51ff8d8a06fd83c8b44 (patch)
tree2a893158863af9aa5c448c03b3b2d7d4b5914b1b /lib/cli.js
parent2a80c67ef8c12c3d9d254f5be6293a6461067d99 (diff)
Set process.title a bit more usefully
This includes all positional args (ie, not anything that is a config), except for the third positional arg when running `npm token revoke ...`, since that is also a secret. Makes the `ps` entry a bit more useful than just "npm", so users can at least get some clue what npm is doing, while minimizing the degree to which we leak anything secret. Closes: #1927 Fixes: https://npm.community/t/8400 Related: tmux-plugins/tmux-resurrect#201 Credit: @isaacs Close: #2154 Reviewed-by: @ruyadorno
Diffstat (limited to 'lib/cli.js')
-rw-r--r--lib/cli.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/cli.js b/lib/cli.js
index f06abcd18..910b674ea 100644
--- a/lib/cli.js
+++ b/lib/cli.js
@@ -1,5 +1,7 @@
// Separated out for easier unit testing
module.exports = (process) => {
+ // set it here so that regardless of what happens later, we don't
+ // leak any private CLI configs to other programs
process.title = 'npm'
const {