readline2

WebJar for readline2

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

readline2
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

readline2
WebJar for readline2
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/sboudrias/readline2

Download readline2

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/readline2/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>readline2</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/readline2/
implementation 'org.webjars.npm:readline2:1.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/readline2/
implementation ("org.webjars.npm:readline2:1.0.1")
'org.webjars.npm:readline2:jar:1.0.1'
<dependency org="org.webjars.npm" name="readline2" rev="1.0.1">
  <artifact name="readline2" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='readline2', version='1.0.1')
)
libraryDependencies += "org.webjars.npm" % "readline2" % "1.0.1"
[org.webjars.npm/readline2 "1.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : code-point-at jar [1.0.0,2)
org.webjars.npm : is-fullwidth-code-point jar [1.0.0,2)
org.webjars.npm : mute-stream jar [0.0.5]

Project Modules

There are no modules declared in this project.

readline2 Build Status

Node.js (v0.8 and v0.10) had some bugs and issues with the default Readline 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 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()

Improvements

  • Default options.input as process.stdin
  • Default options.output as process.stdout
  • interface.stdout is wrapped in a MuteStream
  • 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) Licensed under the MIT license.

Versions

Version
1.0.1