Here is documentation about node config:
node myapp.js --NODE_CONFIG='{"Customer":{"dbConfig":{"host":"customerdb.prod"}}}'
BUt what if I run npm
script? In this case all parameters will passed into npm
not nodejs
, am I wrong? How to pass --NODE_CONFIG
from command line?
P.S. set up NODE_CONFIG
as environment variable is not a solution in my case.
In order to inject args into an inner npm command, you need to use a
--
delimiter.package.json
And run this command to inject the NODE_CONFIG