process-env-argv

2.0.4 • Public • Published

process-env-argv

Easy get arguments from process.argv like -a=1 or --a=1

install

npm i process-env-argv
# or
yarn add process-env-argv

compatible with esm and commonjs

// esm mode
import getArgv from 'process-env-argv';

// commonjs
const getArgv = require('process-env-argv');

// use
getArgv(/* default argv from process */);

example

# terminal
node example.js -a=1 --b=2 -c --d ---e:f=5
{ a: 1, b: 2, c: true, d: true, '-e:f': 5 }

Readme

Keywords

none

Package Sidebar

Install

npm i process-env-argv

Weekly Downloads

13

Version

2.0.4

License

MIT

Unpacked Size

6.36 kB

Total Files

8

Last publish

Collaborators

  • aiscaff