# nodejs-cli-runner

> CLI Task Runner Utility in NodeJs

Latest version **1.2.2** (published 2023-05-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install nodejs-cli-runner
pnpm add nodejs-cli-runner
yarn add nodejs-cli-runner
bun add nodejs-cli-runner
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2023-05-09 |
| First published | 2022-09-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 28.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Raghavendra K R |
| Maintainers | sodaru-it |
| Keywords | Nodejs, CLI, Task Runner, cmd, cmdlet, shell |

## Links

- npm: https://www.npmjs.com/package/nodejs-cli-runner
- Repository: https://github.com/sodaru/nodejs-cli-runner
- Homepage: https://github.com/sodaru/nodejs-cli-runner#readme
- Issues: https://github.com/sodaru/nodejs-cli-runner/issues
- npm.io page: https://npm.io/package/nodejs-cli-runner

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [commander](https://npm.io/package/commander.md) ^9.4.0

## 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.2.2 (latest) — 2023-05-09
- 1.2.1 — 2023-02-09
- 1.2.0 — 2022-10-07
- 1.1.3 — 2022-10-06
- 1.1.2 — 2022-09-30
- 1.1.1 — 2022-09-06
- 1.1.0 — 2022-09-06
- 1.0.0 — 2022-09-05
- 0.0.1 — 2022-09-05

## README

# Nodejs CLI Runner

CLI Task Run Utilities for NodeJs

## Install

```
npm i nodejs-cli-runner
```

## Configure a set of Sub Commands

Read and write common file types with cached storage

```typescript
import { rootCommand } from "nodejs-cli-runner";

const program = rootCommand("cmd-name", [
  // set of sub commands
]);

export default program;
```

## To run a task within the command action

```typescript
import { taskRunner } from "nodejs-cli-runner";

await taskRunner(
  taskName, // taskname
  task, // function returning a Promise
  options, // boolean or {verbose: boolean, progressIndicator: boolean} to print more verbose logs and enable progressIndicator
  ...taskArgs // arguments to task function
);
```

## Run a child Process

```typescript
import { childProcess } from "nodejs-cli-runner";

await childProcess(
  dir, // dir to run child process on
  command, // command/ program to execute
  args, // program arguments
  stdout // stdout config,
  stderr: // stderr config,
  prefix?: // prefix string to prefix in all stdout and stderr lines
);
```

## Support

This project is a part of the Open Source Initiative from [Sodaru Technologies](https://sodaru.com)

Write an email to opensource@sodaru.com for queries on this project

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