# power-options

> CLI Option parser for NodeJS

Latest version **0.3.4** (published 2018-11-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install power-options
pnpm add power-options
yarn add power-options
bun add power-options
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.4 |
| Published | 2018-11-01 |
| First published | 2016-05-16 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 2 |
| Unpacked size | 240.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ron Buckton |
| Maintainers | rbuckton |

## Links

- npm: https://www.npmjs.com/package/power-options
- Repository: https://github.com/rbuckton/power-options
- Homepage: https://github.com/rbuckton/power-options#readme
- Issues: https://github.com/rbuckton/power-options/issues
- npm.io page: https://npm.io/package/power-options

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [iterable-query](https://npm.io/package/iterable-query.md) ^1.0.0-pre.1

## Recent versions

- 0.3.4 (latest) — 2018-11-01
- 0.3.3 — 2018-11-01
- 0.3.2 — 2018-11-01
- 0.3.1 — 2018-10-19
- 0.3.0 — 2018-10-19
- 0.2.2 — 2018-10-16
- 0.2.1 — 2018-10-16
- 0.2.0 — 2018-10-16
- 0.1.15 — 2016-10-06
- 0.1.14 — 2016-07-22
- 0.1.13 — 2016-07-21
- 0.1.12 — 2016-07-21
- 0.1.11 — 2016-07-21
- 0.1.10 — 2016-07-21
- 0.1.9 — 2016-06-30
- … 9 more at https://npm.io/package/power-options/versions

## README

# 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

```ts
// 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
}
```

---
_Source: https://npm.io/package/power-options · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
