You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've a main.js and a main-serve.js file. The main.js contains the following:
constargs=require('args')args.option('port','The port on which the app will be running',3000).command('serve','Serves API',['s'])args.parse(process.argv)
When I start my application let's say "node main.js serve -p 5000", how can I access the flags parsed in main.js inside main-serve.js? I already tried "console.log(process.env)" in main-serve to check if the flags are passed using environment variables but that's not the case. So, how can I access the flags from main-serve.js?
The text was updated successfully, but these errors were encountered:
I've a main.js and a main-serve.js file. The main.js contains the following:
When I start my application let's say "node main.js serve -p 5000", how can I access the flags parsed in main.js inside main-serve.js? I already tried "console.log(process.env)" in main-serve to check if the flags are passed using environment variables but that's not the case. So, how can I access the flags from main-serve.js?
The text was updated successfully, but these errors were encountered: