my common nodejs program utilities
npm install jlafer-node-utilThis is my collection of utility functions that I find useful in nearly all NodeJS projects.
npm install --save jlafer-node-util
const args = argvToDict(process.argv);
const fileName = args.filename;
`$3
Returns a base Axios configuration that uses Basic authentication.
`
const baseConfig = getBaseAxiosConfig(
'https://flex-api.twilio.com/v1/', 'joe', 'blow'
);
return axios({...baseConfig, url: FlexFlows});
`$3
Runs the cmd string argument as a command in the NodeJS operating system. The command returns a Promise which resolves to the stdout output on success or the stderr` output on a failure.