package
Handy wrapper of `minimist`
npm install minimistedGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
A handy wrapper of
minimist
npm install minimistedYou can write your cli like the following:
// Your cli's entry point
const main = (argv) => {
}
require('minimisted')(main)where argv is the command line options parsed by minimist i.e. minimist(process.argv.slice(2)).
Using object destructuring syntax, you can write it like the following:
/**
* @param {boolean} help Shows help message if true
* @param {boolean} version Shows the version if true
* ...
* @param {string[]} _ The parameters
*/
const main = ({ help, version, _ }) => {
}
require('minimisted')(main)const minimisted = require('minimisted')process.argv.slice(2).This calls main with command line options parsed by the minimist with the given options.
MIT
Estimated unpacked size across 2 packages.
56.6 kB
Includes dependencies.