# shellparams

> Lib to manage parameters and actions in Node Console applications.

Latest version **1.0.4** (published 2021-08-08) · GNU license · 0 weekly downloads

## Install

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

## 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.4 |
| Published | 2021-08-08 |
| First published | 2021-01-05 |
| Weekly downloads | 0 |
| License | GNU |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 38.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | helliu |
| Keywords | shell, application, parameters, input |

## Links

- npm: https://www.npmjs.com/package/shellparams
- Repository: https://github.com/helliu/shellParams
- Homepage: https://github.com/helliu/shellParams#readme
- Issues: https://github.com/helliu/shellParams/issues
- npm.io page: https://npm.io/package/shellparams

## Recent versions

- 1.0.4 (latest) — 2021-08-08
- 1.0.3 — 2021-05-27
- 1.0.2 — 2021-01-06
- 1.0.1 — 2021-01-05
- 1.0.0 — 2021-01-05

## README

# shellparams

Lib to manage parameters and actions in Node Console applications.


## Installing
```
npm install shellparams
```

## Syntax
```js
let ShellParams = require("shellparams");

ShellParams.create()
.parameters( <PARAM1...ETC>, <ACTION> )
.default( <DEFAULT_ACTION> );
```

## Example

```js
let ShellParams = require("shellparams");

ShellParams.create()
.parameters("create", () => console.log("create selection") )
.parameters("create", "project", () => console.log("creating project"))
.parameters("sum", sumNumbers)
.default(() => console.log("Invalid input."));


function sumNumbers(input1, input2){
   let number1 = Number(input1);
   let number2 = Number(input2);

   let sum = number1 + number2;

   console.log("the sum result is: " + sum);
}
```

Will generate:
```
$ myApp create
$ create selection
```

```
$ myApp create project
$ creating project
```

```
$ myApp sum 2 4
$ the sum result is: 6
```

```
$ myApp adfasdfa
$ Invalid input.
```

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