# cli-hander

> A command line interface handler for the CLI

Latest version **0.0.1** (published 2022-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install cli-hander
pnpm add cli-hander
yarn add cli-hander
bun add cli-hander
```

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2022-04-14 |
| First published | 2022-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Carlos Burelo |
| Maintainers | carlos-burelo |
| Keywords | cli, command-line, command-line-interface, command-line-args, command-line-arguments, command-line-parser, handler |

## Links

- npm: https://www.npmjs.com/package/cli-hander
- Repository: https://github.com/carlos-burelo/cli-hander
- Homepage: https://carlosburelo.tk/cli-hander
- Issues: https://github.com/carlos-burelo/cli-handler/issues
- npm.io page: https://npm.io/package/cli-hander

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2022-04-14

## README

# CLI Handler

```ts
import { parse, Directive, Handler } from 'cli-handler';

const generateServiceHandler: Handler = (value, flags) => {
  console.log({
    value,
    flags,
  });
};

const DIRECTIVES: Directive[] = [
  {
    path: 'g|generate',
    description: 'Generate a new project',
    children: [
      {
        input: true,
        path: 'c|component',
        description: 'Template to use',
      },
      {
        input: true,
        path: 's|service',
        description: 'Template to use',
        flags: ['flat', 'tests'],
        handler: generateServiceHandler,
      },
    ],
  },
];
parse(DIRECTIVES);
```

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