# st-cl-parser

> Module to parse command line arguments.

Latest version **0.6.0** (published 2021-06-28) · SEE LICENSE IN LICENSE.md license · 0 weekly downloads

## Install

```sh
npm install st-cl-parser
pnpm add st-cl-parser
yarn add st-cl-parser
bun add st-cl-parser
```

## 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.6.0 |
| Published | 2021-06-28 |
| First published | 2020-09-09 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.md |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | mstark |
| Maintainers | mstark5652 |

## Links

- npm: https://www.npmjs.com/package/st-cl-parser
- Repository: https://github.com/mstark5652/command-line-parser
- Homepage: https://github.com/mstark5652/command-line-parser#readme
- Issues: https://github.com/mstark5652/command-line-parser/issues
- npm.io page: https://npm.io/package/st-cl-parser

## Dependencies (1)

- [@actions/github](https://npm.io/package/@actions/github.md) ^4.0.0

## Recent versions

- 0.6.0 (latest) — 2021-06-28
- 0.5.3 — 2021-03-12
- 0.5.2 — 2020-10-30
- 0.5.1 — 2020-09-11
- 0.5.0 — 2020-09-09
- 0.4.0 — 2020-09-09

## README

# st-cl-parser

## Overview
Utility to parser command line arguments in a simple but effective way. This module has no external dependencies and was build to be straight forward with no extra frills.

## Install
Using npm with git
`npm install --save-dev st-cl-parser`

## Types of Arguments
* values - `node index.js --srcDir='./src/'` argument with label that provides a value to be passed through
* boolean - `node index.js --debug` argument parameters but provides to value (If excluded value is false/undefined. If passed in argv, then value is true.)
* flags - `node index.js -a -bc` a,b,c would all be considered flags (single letter and single hypen)
* attributes - `node index.js release` 'release' would be considered an attribute in this case. I like to think of them as commands. (multiple can be passed)

## Usage
```js
var parseArgs = require('st-cl-parser');
var args = parseArgs(process.argv);
console.log(args);
```
```bash
{
    srcDir: './src/',
    debug: true,
    attrs: [
        'release'
    ],
    flags: [
        'a',
        'b'
    ]
}
```

## Examples
* `node ./test.js --debug release -ab -a -edc --config=./config.js`
```js
var options = parseArgs();
console.log(options);
{
  executor: '/Users/mstark5652/.nvm/versions/node/v12.13.1/bin/node',
  script: '/Users/mstark5652/dev/js/st-cl-parser/test.js',
  flags: [ 'a', 'b', 'e', 'd', 'c' ],
  attrs: [ 'release' ],
  debug: true,
  config: './config.js'
}
```


## License
MIT License - See LICENSE.md

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