Simplify the way you read nodeJS command line arguments.
The double dash used to declare a variable and the rest are the values of the variable.
The dynaNodeArguments
is an object variable with values.
import {dynaNodeArguments} from "dyna-node-arguments"
{
"node": "/Users/john/.nvm/versions/node/v12.16.1/bin/node",
"app": "myApp.js",
"args": {
"root": "",
},
}
{
"node": "/Users/john/.nvm/versions/node/v12.16.1/bin/node",
"app": "myApp.js",
"args": {
"ENV_MODE": "production",
"root": "",
},
}
{
"node": "/Users/john/.nvm/versions/node/v12.16.1/bin/node",
"app": "myApp.js",
"args": {
"ENV_MODE": "production secure",
"root": "",
},
}
{
"node": "/Users/john/.nvm/versions/node/v12.16.1/bin/node",
"app": "myApp.js",
"args": {
"ENV_MODE": "production secure",
"TARGET": "mobile android",
"root": "",
},
}
{
"node": "/Users/john/.nvm/versions/node/v12.16.1/bin/node",
"app": "myApp.js",
"args": {
"ENV_MODE": "production -secure",
"root": "-verbose",
},
}
{
"node": "/Users/john/.nvm/versions/node/v12.16.1/bin/node",
"app": "myApp.js",
"args": {
"ENV_MODE": "production secure",
"TARGET": "mobile android",
"root": "basics",
},
}
{
"node": "/Users/john/.nvm/versions/node/v12.16.1/bin/node",
"app": "myApp.js",
"args": {
"mode": "silent",
"root": "build verbose",
"title": "Hello World v2",
},
}