@vmadden191/kargs
v1.0.68
Published
(_keith's version of [yargs](https://yargs.js.org/)_)
Downloads
25
Readme
Kargs
(keith's version of yargs)
publishing new versions to npm
- run
node ./build_scripts/bump-version.js
- commit to github
- if you're not logged in to npm, run
npm adduser
- use your vmadden191 npm credentials
- run
npm run build
- run
npm publish
Notes
- Formatted help appears when no args are given, or when the arg
--help
is used - arg types:
- array
- float
- integer
- string
- switch
- option attributes
- isDefault
- no arg/alias is necessary
- isRequired
- cantUseWith
- choices: ["foo", "bar"]
- description (for
--help
)
- isDefault
Example usage
const { parseArgs } = require("@vmadden191/kargs");
const parsedArgs = parseArgs({
match: {
type: "string",
alias: "m",
isDefault: true,
isRequired: true,
description: "the match string",
},
show: {
type: "integer",
alias: "s",
cantUseWith: "copy",
description: `show the last [x] matches (default is 1)`,
},
copy: {
type: "integer",
alias: "c",
description: `copy previous [x]th string (default is 1)`,
},
});