import minimist from 'minimist'; const args = minimist(process.argv.slice(2)); console.log(args);
import minimist from 'minimist'; const args = minimist(process.argv.slice(2), { default: { port: 3000, env: 'development' } }); console.log(args);This code example uses Typescript Minimist to set default values for command-line options. The `default` option is used to specify the default values for the `port` and `env` options. If these options are not specified on the command line, they will be set to the default values specified in the `default` object. Package library: minimist is an open-source package library that is available on npmjs.com. It can be installed using the `npm install minimist` command and can be used in any Node.js project that requires command line argument parsing.