Package Exports
- minimisted
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (minimisted) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
minimisted v1.0.1
Handy wrapper of
minimist
minimist
is a nice handy library for parsing the command line options, but its interface is not such nice and a bit too tedious if you use it a number of times. This library gives you an interface to use minimist
a bit more declarative way.
Usage
You can write your cli like the following:
// Your cli's entry point
const main = (argv) => {
}
require('minimisted')(main)
where argv
is the parsed command line options by minimist
, which is exactly the same as 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)
You can forget about what minimist
does and you can only get what you want i.e. the parsed argv
object.
License
MIT