replMod

object replMod
class Object
trait Matchable
class Any

Type members

Classlikes

@native @JSType
trait REPLCommand extends StObject
Companion
object
object REPLCommand
Companion
class
@JSImport("repl", "REPLServer") @native @JSType
class REPLServer extends StObject

Provides a customizable Read-Eval-Print-Loop (REPL).

Provides a customizable Read-Eval-Print-Loop (REPL).

Instances of repl.REPLServer will accept individual lines of user input, evaluate those according to a user-defined evaluation function, then output the result. Input and output may be from stdin and stdout, respectively, or may be connected to any Node.js stream.

Instances of repl.REPLServer support automatic completion of inputs, simplistic Emacs-style line editing, multi-line inputs, ANSI-styled output, saving and restoring current REPL session state, error recovery, and customizable evaluation functions.

Instances of repl.REPLServer are created using the repl.start() method and should not be created directly using the JavaScript new keyword.

See also
@JSImport("repl", "Recoverable") @native @JSType
class Recoverable extends StObject with Error

Indicates a recoverable error that a REPLServer can use to support multi-line input.

Indicates a recoverable error that a REPLServer can use to support multi-line input.

See also
@native @JSType
trait ReplOptions extends StObject
Companion
object
object ReplOptions
Companion
class

Types

type REPLCommandAction = ThisFunction1[REPLServer, String, Unit]
type REPLEval = ThisFunction4[REPLServer, String, Context, String, Function2[Error | Null, Any, Unit], Unit]
type REPLWriter = ThisFunction1[REPLServer, Any, String]

Value members

Concrete methods

@inline

Creates and starts a repl.REPLServer instance.

Creates and starts a repl.REPLServer instance.

Value Params
options

The options for the REPLServer. If options is a string, then it specifies the input prompt.

@inline
def start(options: ReplOptions): REPLServer
@inline
def start(options: String): REPLServer

Concrete fields

@JSImport("repl", "REPL_MODE_SLOPPY") @native
val REPL_MODE_SLOPPY: Symbol

A flag passed in the REPL options. Evaluates expressions in sloppy mode.

A flag passed in the REPL options. Evaluates expressions in sloppy mode.

@JSImport("repl", "REPL_MODE_STRICT") @native
val REPL_MODE_STRICT: Symbol

A flag passed in the REPL options. Evaluates expressions in strict mode. This is equivalent to prefacing every repl statement with 'use strict'.

A flag passed in the REPL options. Evaluates expressions in strict mode. This is equivalent to prefacing every repl statement with 'use strict'.

@JSImport("repl") @native
val ^: Any
@JSImport("repl", "writer") @native

This is the default "writer" value, if none is passed in the REPL options, and it can be overridden by custom print functions.

This is the default "writer" value, if none is passed in the REPL options, and it can be overridden by custom print functions.