# @akiojin/argument-builder

> This package implements a class that creates command line parameters.

Latest version **1.0.3** (published 2025-01-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @akiojin/argument-builder
pnpm add @akiojin/argument-builder
yarn add @akiojin/argument-builder
bun add @akiojin/argument-builder
```

## Health

**Score 40/100 (D)** — status: stable.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2025-01-10 |
| First published | 2022-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Akio Jinsenji |
| Maintainers | akiojin |
| Keywords | command, cli |

## Links

- npm: https://www.npmjs.com/package/@akiojin/argument-builder
- Repository: https://github.com/akiojin/argument-builder
- Homepage: https://github.com/akiojin/argument-builder#readme
- Issues: https://github.com/akiojin/argument-builder/issues
- npm.io page: https://npm.io/package/@akiojin/argument-builder

## 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

- 1.0.3 (latest) — 2025-01-10
- 1.0.0 — 2022-03-20
- 0.1.3 — 2022-03-17
- 0.1.2 — 2022-03-17
- 0.1.1 — 2022-03-16
- 0.1.0 — 2022-03-16

## README

# argument-builder
This package implements a class that creates command line parameters.

## Usage
```js
import { ArgumentBuilder } from '@akiojin/argument-builder'
```
```js
const builder = new ArgumentBuilder()
builder
    .Append('--verbose')
    .Append('--file', 'log.txt')
    .Append([ '--output', './out' ])
await execa.execa('foo', builder.Build())
```

## Reference
### class `ArgumentBuilder`
#### `Append(arg: string | string[], param?: string): ArgumentBuilder`
##### Description
Add an argument.

##### Arguments
|Name|Type|Description|
|:--|:--|:--|
|`arg`|`string` \| string[]|Commands to pass to command line|
|`param?`|`string`|Parameters to be added to the command|

##### Return
|Type|Description|
|:--|:--|
|`ArgumentBuilder`|Return this|


#### `Count(): number`
##### Description
Returns the number of arguments added.

##### Return
|Type|Description|
|:--|:--|
|`number`|Number of arguments|


#### `Build(): string[]`
##### Description
Returns an array of arguments to be passed to the command line.

##### Return
|Type|Description|
|:--|:--|
|`string[]`|Argument array|


#### `ToString(): string`
##### Description
Return arguments as a single space-delimited string

##### Return
|Type|Description|
|:--|:--|
|`string`|Return arguments as a single space-delimited string|

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