# input-stdin

> A stdin CLI utility for NodeJS

Latest version **1.0.0** (published 2019-07-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install input-stdin
pnpm add input-stdin
yarn add input-stdin
bun add input-stdin
```

## 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.0 |
| Published | 2019-07-04 |
| First published | 2019-07-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Brian Swisher |
| Maintainers | bswisher |

## Links

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

## Recent versions

- 1.0.0 (latest) — 2019-07-04

## README

# input-stdin
A stdin CLI utility for NodeJS

### install
```bash
npm i input-stdin --save
```

### usage
```javascript
((require) => {
  const readLine = require('input-stdin')(`
1
2
`)
  const myFunction = (a, b) => a + b
  const test = (result, expect) => result === expect && `✅ ${expect}` || `🔴 ${expect}`

  const a = parseInt(readLine())
  const b = parseInt(readLine())
  const result = myFunction(a, b)

  console.log(test(result, 2))
  console.log(test(result, 3))
  console.log(test(result, 4))
})(require);
```

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