# @vimlet/cli

Latest version **1.2.8** (published 2019-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vimlet/cli
pnpm add @vimlet/cli
yarn add @vimlet/cli
bun add @vimlet/cli
```

Provides the command `vimlet-cli`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.8 |
| Published | 2019-04-17 |
| First published | 2017-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | devsvimlet, lethevimlet |

## Links

- npm: https://www.npmjs.com/package/@vimlet/cli
- npm.io page: https://npm.io/package/@vimlet/cli

## Recent versions

- 1.2.8 (latest) — 2019-04-17
- 1.2.7 — 2018-12-18
- 1.2.6 — 2018-12-03
- 1.2.5 — 2018-12-03
- 1.2.4 — 2018-05-22
- 1.2.3 — 2018-05-22
- 1.2.2 — 2018-05-21
- 1.2.1 — 2018-05-21
- 1.2.0 — 2018-03-07
- 1.1.0 — 2018-03-07
- 1.0.0 — 2017-12-11
- 0.0.3 — 2017-12-10
- 0.0.2 — 2017-12-10
- 0.0.1 — 2017-12-10

## README

<p align='center'>
<img src='https://vimlet.com/resources/img/cli-txt.png' title='Vimlet Cli' alt='Vimlet Cli' height="150">
</p>

Command line interface for node.js. The easiest way to handle your application from console.

## Installation

`npm install @vimlet/cli`

## How to use

`var cli = require("@vimlet/cli").instantiate();`


 **vimlet-cli** accepts flags and values: 
* flag: Commands which don't have value, like a boolean option. `flag("shorcut", "flagName", "description")`
* value: Commands that will have a value. `value("shorcut", "valueName", "description")`


`value(shortcut, name, description, handler)`

`flag(shortcut, name, description)`

* shortcut: they are not mandatory, they can be null o rempty.
* name: value or flag name.
* description: String to be shown on help.
* handler: a function to be applied to the data inserted by the user.

IE:

```[javascript]
cli
.flag("w", "windows", "This flag will set the platform as windows")
.value("e", "extension", "This value will tell the extension of the output file")
.flag("h", "--help", "Shows help")
.parse(arg);
```

* `parse()` must be called at the end to parse the arguments.
* `arg` arguments is a string that can be taken from console or wherever the user wants.

As an example call: `example w e exe` => This will set the platform as windows and the extension to exe.


> Value also accept a handler as last param

> `value("t", "--test", "test handler", function(value){return value.split(",");})`

> In the example above, test data will be splitted by comas.

- `cli.printHelp();` Is a default function to print help in the console like:

|Shortcut|Name|Description|
|---|---|---|
|h|help|Print help|

## License
Vimlet Cli is released under MIT License. See [LICENSE](https://github.com/vimlet/vimlet-cli/blob/master/LICENSE) for details.

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