1.1.1 • Published 5 years ago

@cuties/readline v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

cutie-readline

NPM Version Build Status codecov

Cutie extension for readline module in Node. It's based on the Async Tree Pattern.

Examples

You can find examples of using this library in the test directory.

Install

npm install @cuties/readline

Run test

npm test

Run build

npm run build

Usage

const {
  // Needed async objects here from the table below
} = require('@cuties/readline');

For more information about parameters in the async objects visit docs of Node for readline module.

interface

Async ObjectAsync/sync callParameters(default value/description)Representation result
ClosedInterfaceInterface.closeInterfaceInterface
CreatedInterfacereadline.createInterfaceInterface, optionsInterface
InterfaceWithCloseEventInterface.on('close', event)Interface, event(Event with definedBody())Interface
InterfaceWithLineEventInterface.on('line', event)Interface, event(Event with definedBody(input))Interface
InterfaceWithPauseEventInterface.on('pause', event)Interface, event(Event with definedBody())Interface
InterfaceWithPromptInterface.setPromptpromptInterface
InterfaceWithResumeEventInterface.on('resume', event)Interface, event(Event with definedBody())Interface
InterfaceWithSIGCONTEventInterface.on('SIGCONT', event)Interface, event(Event with definedBody())Interface
InterfaceWithSIGINTEventInterface.on('SIGINT', event)Interface, event(Event with definedBody())Interface
InterfaceWithSIGTSTPEventInterface.on('SIGTSTP', event)Interface, event(Event with definedBody())Interface
PausedInterfaceInterface.pauseInterfaceInterface
PromptedInterfaceInterface.promptInterface[, preserveCursor]Interface
QuestionedInterfaceInterface.questionInterface, query, event(Event with definedBody(answer))Interface
ResumedInterfaceInterface.resumeInterfaceInterface
WrittenInterfaceInterface.writeInterface, data[, key]Interface

stream and other structures

Async ObjectAsync/sync callParameters(default value/description)Representation result
AnswersOfQuestionedInterfaceInterface.questionInterface, query[, previousAnswers(is AnswersOfQuestionedInterface or string[])]string[]
StreamWithClearedLinereadline.clearLinestream, dirstream
StreamWithClearedScreenDownreadline.clearScreenDownstreamstream
StreamWithCursorToreadline.streamWithCursorTostream, x, ystream
StreamWithEmittedKeypressEventsreadline.emitKeypressEventsstream[, interface]stream
StreamWithMovedCursorreadline.moveCursorstream, dx, dystream