# commandliner

> Build standard commands for the use with exec

Latest version **0.2.0** (published 2014-06-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install commandliner
pnpm add commandliner
yarn add commandliner
bun add commandliner
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2014-06-09 |
| First published | 2014-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Finn Pauls |
| Maintainers | finnpauls |
| Keywords | command, cmd, cli, build, exec |

## Links

- npm: https://www.npmjs.com/package/commandliner
- Repository: http://github.com/finnp/commandLiner
- Homepage: https://github.com/finnp/commandLiner
- Issues: https://github.com/finnp/commandLiner/issues
- npm.io page: https://npm.io/package/commandliner

## Dependencies (2)

- [shell-quote](https://npm.io/package/shell-quote.md) ^1.4.1
- [typechecker](https://npm.io/package/typechecker.md) ^2.0.8

## 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.2.0 (latest) — 2014-06-09
- 0.1.2 — 2014-06-06
- 0.1.1 — 2014-06-01
- 0.1.0 — 2014-04-22
- 0.0.1 — 2014-04-21

## README

# commandLiner
Max / Linux | Windows
--- | ---
[![Build Status](https://travis-ci.org/finnp/commandLiner.svg?branch=master)](https://travis-ci.org/finnp/commandLiner) | [![Windows Build status](http://img.shields.io/appveyor/ci/finnp/commandLiner.svg)](https://ci.appveyor.com/project/finnp/commandLiner/branch/master)

This is not another command option parser. It's the opposite. A command option builder for the use with exec. It will use
[shell-quote](https://github.com/substack/node-shell-quote) by substack to escape the options. 

## Example

```javascript
	var Commandliner = require('commandliner');
	var exec = require('child_process').exec;
	var say = new Commandliner('say', {interactive: true}, 'Hello, there!');
	say.options.voice = 'Zarvox';
	// Evaluates to: say --interactive -v Zarvox 'Hello, there!'
	exec(say); // implicit call to toString()
```

You can also just build the String directly like this.

```javascript
    var command = Commandliner.build(['git', 'commit', {m: 'Adds this new feature everyone loves'}]);
    // Evaluates to: git commit -m 'Add this new feature everyone loves'
    var command = Commandliner.build(['docker', 'run', 'something', '.']);
    // Evaluates to: docker run something .
```

## Attributes of new Commandliner()

| Attribute  |  Example |  Example value
| ------ | ------- | ------
| program | git   | `'git'`
| command | add | `'add'`
| options | -v -n | `{'v': true, 'n': true}`
| args | index.js test.js | `['index.js', 'test.js']`

Be aware of this since you could be thinking that "command" 
is the first argument, but I decided to call it program.

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