0.3.4 • Published 7 years ago

power-options v0.3.4

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
7 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

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.15

9 years ago

0.1.14

9 years ago

0.1.13

9 years ago

0.1.12

9 years ago

0.1.11

9 years ago

0.1.10

9 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago