# cli2json

> A tool to help parse your command line arguments and flags into an organized JSON.

Latest version **1.0.0** (published 2021-12-26) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-12-26 |
| First published | 2021-12-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | diegab |

## Links

- npm: https://www.npmjs.com/package/cli2json
- npm.io page: https://npm.io/package/cli2json

## Recent versions

- 1.0.0 (latest) — 2021-12-26

## README

# cli2json
A tool to help parse your command line arguments and flags into an organized JSON. 

## Note
cli2json will split commands by each space, so only use this for a tool you know will not need a space, unless you can merge the command and flag together.

# Usage
index.js
```javascript
var parser = require("cli2json");
console.log(parser.parse(process.argv.slice(2).join(" "), {
  readCommandAfter: ["-t", "--test"]
}))
/*
 {
  commands: [
    'index.js'
  ],
  flags: [
  '--test Hello!'
  ]
}
*/
```
Run this to see it in action:
```
node . --test Hello!
```

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