natron-args-parser
v0.2.0-beta.1
Published
Parse Command-Line Arguments
Downloads
3
Readme
Parse Command-Line Arguments
This module is part of Natron and contains utilities for parsing command-line arguments.
Documentation
See the documentation for natron-args-parser
Usage
import {parse} from "natron-args-parser";
// process.argv.slice(2) = [
// "arg1",
// "--foo",
// "arg2",
// "--bar",
// "value",
// "--num=12345",
// ]
let args = parse(process.argv.slice(2), {
flags: {
"foo": {
type: "boolean",
},
},
greedy: true,
});
// args = {
// "_": ["arg1", "arg2"],
// "foo": true,
// "bar": "value",
// "num": 12345,
// }