1.7.0 • Published 5 years ago
@unsc/parse v1.7.0
parse
install
npm install --save @unsc/parse
usage
import parse from "@unsc/parse";
const custom = parse("my command here --myOption John -myFlag");
// const custom = parse(process.argv); <- You can do this too!
parsed.getCommand(); // my command here
parsed.getOptions(); // { myOption: "John", myFlag: true }
parsed.getOption("myOption"); // John
parsed.getOption("myFlag"); // true
That's it! 😜 You now have access to the parsed arguments.
extras
You can even listen for commands using .on
.
parse.on("my command here", function(options) {
// the first .on to match gets called, others get ignored
});
contribute
Pull requests are encouraged.
1.7.0
5 years ago
1.7.6
5 years ago
1.6.6
5 years ago
1.5.6
5 years ago
1.5.5
5 years ago
1.5.4
5 years ago
1.5.3
5 years ago
1.5.2
5 years ago
1.5.1
5 years ago
1.5.0
5 years ago
1.4.7
5 years ago
1.4.6
5 years ago
1.3.5
5 years ago
1.3.4
5 years ago
1.3.3
5 years ago
1.3.2
5 years ago
1.2.2
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago