1.1.1 • Published 2 years ago

pm2-node-argv v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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
1.1.1

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago