![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mets.corals.io/wp-content/metras.v32.1/node_modules/minimist-options/ |
# minimist-options [](https://travis-ci.org/vadimdemedes/minimist-options) > Write options for [minimist](https://npmjs.org/package/minimist) in a comfortable way. ## Installation ``` $ npm install --save minimist-options ``` ## Usage ```js const buildOptions = require('minimist-options'); const minimist = require('minimist'); const options = buildOptions({ name: { type: 'string', alias: 'n', default: 'john' }, force: { type: 'boolean', alias: ['f', 'o'], default: false }, published: 'boolean', // special option for positional arguments (`_` in minimist) arguments: 'string' }); const args = minimist(options); ``` instead of: ```js const minimist = require('minimist'); const options = { string: ['name', '_'], boolean: ['force', 'published'], alias: { n: 'name', f: 'force', o: 'force' }, default: { name: 'john', f: false } }; const args = minimist(options); ``` ## License MIT © [Vadim Demedes](https://vadimdemedes.com)