# readline2

> Readline Façade fixing bugs and issues found in releases 0.8 and 0.10

Latest version **1.0.1** (published 2015-07-17) · MIT license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2015-07-17 |
| First published | 2014-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 27 |
| Author | Simon Boudrias |
| Maintainers | sboudrias |
| Keywords | cli, terminal, readline, tty, ansi |

## Links

- npm: https://www.npmjs.com/package/readline2
- Repository: https://github.com/sboudrias/readline2
- Homepage: https://github.com/sboudrias/readline2#readme
- Issues: https://github.com/sboudrias/readline2/issues
- npm.io page: https://npm.io/package/readline2

## Dependencies (3)

- [mute-stream](https://npm.io/package/mute-stream.md) 0.0.5
- [code-point-at](https://npm.io/package/code-point-at.md) ^1.0.0
- [is-fullwidth-code-point](https://npm.io/package/is-fullwidth-code-point.md) ^1.0.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.0.1 (latest) — 2015-07-17
- 1.0.0 — 2015-07-17
- 0.1.1 — 2015-01-21
- 0.1.0 — 2014-02-01

## README

readline2 [![Build Status](https://travis-ci.org/SBoudrias/readline2.png?branch=master)](https://travis-ci.org/SBoudrias/readline2)
=========

Node.js (v0.8 and v0.10) had some bugs and issues with the default [Readline](http://nodejs.org/api/readline.html) module.

This module include fixes seen in later version (0.11-0.12 and iojs) and ease some undesirable behavior one could see using the readline to create interatives prompts. This means `readline2` change some behaviors and as so is **not** meant to be an exact drop-in replacement.

This project is extracted from the core of [Inquirer.js interactive prompt interface](https://github.com/SBoudrias/Inquirer.js) to be available as a standalone module.


Documentation
-------------

**Installation**: `npm install --save readline2`

### readline2.createInterface(options); -> {Interface}

Present the same API as [Node.js `readline.createInterface()`](http://nodejs.org/api/readline.html)

#### Improvements
- Default `options.input` as `process.stdin`
- Default `options.output` as `process.stdout`
- `interface.stdout` is wrapped in a [MuteStream](https://github.com/isaacs/mute-stream)
- Prevent `up` and `down` keys from moving through history inside the readline
- Fix cursor position after a line refresh when the `Interface` prompt contains ANSI colors
- Correctly return the cursor position when faced with implicit line returns


License
-------------

Copyright (c) 2012 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
Licensed under the MIT license.

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