# cli-io

> Command-Line Interface I/O

Latest version **0.9.13** (published 2024-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install cli-io
pnpm add cli-io
yarn add cli-io
bun add cli-io
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.13 |
| Published | 2024-10-20 |
| First published | 2020-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 7 |
| Unpacked size | 17.6 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Dr. Ralf S. Engelschall |
| Maintainers | rse |
| Keywords | cli, input, output, stdin, stdout, file, url |

## Links

- npm: https://www.npmjs.com/package/cli-io
- Repository: https://github.com/rse/cli-io
- Issues: https://github.com/rse/cli-io/issues
- npm.io page: https://npm.io/package/cli-io

## Dependencies (7)

- [got](https://npm.io/package/got.md) 11.8.6
- [chalk](https://npm.io/package/chalk.md) 4.1.2
- [dayjs](https://npm.io/package/dayjs.md) 1.11.13
- [webdav](https://npm.io/package/webdav.md) 4.11.2
- [js-yaml](https://npm.io/package/js-yaml.md) 4.1.0
- [get-stream](https://npm.io/package/get-stream.md) 6.0.1
- [strip-ansi](https://npm.io/package/strip-ansi.md) 6.0.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.9.13 (latest) — 2024-10-20
- 0.9.12 — 2024-03-24
- 0.9.11 — 2023-12-09
- 0.9.10 — 2023-12-09
- 0.9.9 — 2023-05-01
- 0.9.8 — 2022-03-26
- 0.9.7 — 2021-11-06
- 0.9.6 — 2021-01-09
- 0.9.5 — 2020-11-20
- 0.9.4 — 2020-11-20
- 0.9.3 — 2020-11-20
- 0.9.2 — 2020-11-20
- 0.9.1 — 2020-11-01
- 0.9.0 — 2020-11-01

## README

CLIio
=====

Command-Line Interdace I/O

<p/>
<img src="https://nodei.co/npm/cli-io.png?downloads=true&stars=true" alt=""/>

<p/>
<img src="https://david-dm.org/rse/cli-io.png" alt=""/>

About
-----

CLIio is a small JavaScript library for Node.js, providing three
reusable functionalities every Command-Line Interface (CLI) usually
requires: reading input data, writing output data and logging verbose
messages. The crux of CLIio is its encapsulated flexibility:

-  reading input data is supported from `stdin` (with filenames `-` or `stdin:`),
   from URLs with HTTP (with filenames starting with `http:` or `https:`)
   and from local files (with filenames starting with `file:` or no scheme);

-  writing output data is supported to `stdout` (with filenames `-` or `stdout:`),
   to URLs with HTTP/WebDAV (with filenames starting with `http:` or `https:`)
   and to local files (with filenames starting with `file:` or no scheme).

Installation
------------

```shell
$ npm install cli-io
```

Usage
-----

```js
const CLIio = require("cli-io")

const cli = new CLIio()

cli.log("info", "sample")

let data = await cli.input(inputURL)

...work on data...

await cli.output(outputURL)
```

License
-------

Copyright (c) 2020-2023 Dr. Ralf S. Engelschall (http://engelschall.com/)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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