0.3.4 • Published 6 years ago

power-options v0.3.4

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
6 years ago

power-options

CLI Option parser for NodeJS

This library contains an advanced CLI option parser for NodeJS console applications.

Installing

For the latest version:

npm install power-options

Usage

// Importing (TypeScript)
import { parseCommandLine } from "power-options";

// Importing (JavaScript - CommonJS)
const parseCommandLine = require("power-options").parseCommandLine;

// Usage
const { options, help, error, status, group } = parseCommandLine(process.argv.slice(2), {
    options: {
        "help": { shortName: "h", alias: ["?"], help: true },
        "version": { shortName: "v" },
    }
});

if (error) {
    console.error(error);
    if (help) {
        // print help
    }
    process.exit(status);
}
else if (help) {
    // print help
    process.exit(0);
}
else {
    // use options/group
}
0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.15

8 years ago

0.1.14

8 years ago

0.1.13

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago