0.1.1 • Published 5 years ago

ease-args v0.1.1

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

ease-args

A lightweight command line arguments parser that can be used nested like docker command line.

Install

npm install ease-args

Example

code

    const easeArgs = require("ease-args");

    var res = easeArgs(process.argv, {
        "help": { type: Boolean, default: true },
        "set": { type: String, default: "" },
    }, {
        "h": "help",
        "s": "set",
    });
    console.log(`res: ${JSON.stringify(res)}`);

command line

node . --set "hello-world" "hello-world" "I am test."

output

res: {"route":"/","options":{"set":"hello-world"},"content":"hello-world","I am test."}

0.1.1

5 years ago

0.1.0

5 years ago