# @slimio/stdin

> Node.js light standard input (stdin) crafted for REPL experience

Latest version **1.0.3** (published 2019-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @slimio/stdin
pnpm add @slimio/stdin
yarn add @slimio/stdin
bun add @slimio/stdin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-09-12 |
| First published | 2019-09-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | SlimIO |
| Maintainers | ahkrin, alexandre.malaj, captainfive, fraxken, kawacrepe, mcroquet |
| Keywords | nodejs, node, stdin, input, repl, REPL, interactive, cli, command-line, interfaces, prompt |

## Links

- npm: https://www.npmjs.com/package/@slimio/stdin
- Repository: https://github.com/SlimIO/stdin
- Homepage: https://github.com/SlimIO/stdin#readme
- Issues: https://github.com/SlimIO/stdin/issues
- npm.io page: https://npm.io/package/@slimio/stdin

## Dependencies (2)

- [string-length](https://npm.io/package/string-length.md) ^3.1.0
- [fast-levenshtein](https://npm.io/package/fast-levenshtein.md) ^2.0.6

## 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.0.3 (latest) — 2019-09-12
- 1.0.2 — 2019-09-11
- 1.0.1 — 2019-09-11
- 1.0.0 — 2019-09-11

## README

# Stdin
![version](https://img.shields.io/badge/dynamic/json.svg?url=https://raw.githubusercontent.com/SlimIO/stdin/master/package.json&query=$.version&label=Version)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/SlimIO/stdin/commit-activity)
![MIT](https://img.shields.io/github/license/mashape/apistatus.svg)
![dep](https://img.shields.io/david/SlimIO/stdin)
![size](https://img.shields.io/github/languages/code-size/SlimIO/stdin)

Node.js light standard input (stdin) crafted for REPL experience

## Requirements
- [Node.js](https://nodejs.org/en/) v10 or higher

## Getting Started

This package is available in the Node Package Repository and can be easily installed with [npm](https://docs.npmjs.com/getting-started/what-is-npm) or [yarn](https://yarnpkg.com).

```bash
$ npm i @slimio/stdin
# or
$ yarn add @slimio/stdin
```

## Usage example
```js
const stdin = require("@slimio/stdin");

async function main() {
    const result = await stdin("Question title > ", {
        history: ["command in history 1", "command in history 2"],
        autocomplete: [
            "events",
            "events.get_info"
        ]
    });
    console.log(result);
}
main().catch(console.error);
```

## API

### stdin(query: null | string, options?: Options): Promise< string >
Query paramaters can be set to `null` to disable the title. Options is described by the following TypeScript interface:

```ts
interface Options {
    history?: string[];
    autocomplete?: string[];
}
```

## Dependencies

|Name|Refactoring|Security Risk|Usage|
|---|---|---|---|
|[fast-levenshtein](https://github.com/hiddentao/fast-levenshtein#readme)|Major|Low|Implementation of levenshtein algo to found similar strings for auto-completion|
|[string-length](https://github.com/sindresorhus/string-length#readme)|Major|Low|Get the real string length|

## License
MIT

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