New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

pm2-node-argv

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pm2-node-argv

pm2, node, npm script args

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

pm2-node-argv

Get pm2, node, npm inject arguments

Install

Using npm:

npm install pm2-node-argv

or using yarn:

yarn add pm2-node-argv

How to Use ?

Pm2

Inject arguments:
pm2 start xxx.js -- --port=5005 --name=lucas

Get arguments:
const { getArgv } = require('pm2-node-argv')
const obj = getArgv();
console.log('obj', obj)
// {
//   "port": 5005,
//   "name": lucas
// }

Node

Inject arguments:
node xxx.js -- --port=5005 --name=lucas

Get arguments:
const { getArgv } = require('pm2-node-argv')
const obj = getArgv();
console.log('obj', obj)
// {
//   "port": 5005,
//   "name": lucas
// }

Npm

Inject arguments:
pm2 start xxx.js -- --port=5005 --name=lucas

Get arguments:
const { getArgv } = require('pm2-node-argv')
const obj = getArgv();
console.log('obj', obj)
// {
//   "port": 5005,
//   "name": lucas
// }

npm start xxx -- --port=5005 --name=lucas

Keywords

pm2

FAQs

Package last updated on 15 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts