A simple arguments parser for Deno.
- Inspired by Python's argparse module
- No dependencies
- Strongly typed APIs
Write example.ts
like below:
import { ArgumentsParser } from "https://deno.land/x/arguments_parser/mod.ts";
const parser = new ArgumentsParser({
message: {
names: ["-m", "--message"],
parser: String
}
});
const args = parser.parseArgs();
console.log(args.message);
And execute it:
deno run example.ts -m "hello!"
Check .../example.ts
hello!