Lines Matching refs:repl
7 <!-- source_link=lib/repl.js -->
9 The `node:repl` module provides a Read-Eval-Print-Loop (REPL) implementation
14 const repl = require('node:repl');
19 The `node:repl` module exports the [`repl.REPLServer`][] class. While running,
20 instances of [`repl.REPLServer`][] will accept individual lines of user input,
25 Instances of [`repl.REPLServer`][] support automatic completion of inputs,
81 By default, all instances of [`repl.REPLServer`][] use an evaluation function
84 evaluation function when the [`repl.REPLServer`][] instance is created.
110 const repl = require('node:repl');
113 repl.start('> ').context.m = msg;
128 const repl = require('node:repl');
131 const r = repl.start('> ');
157 repl is used as standalone program.
170 const r = repl.start();
254 [`--no-experimental-repl-await`][] shall disable top-level await in REPL.
279 When a new [`repl.REPLServer`][] is created, a custom evaluation function may be
287 const repl = require('node:repl');
296 repl.start({ prompt: '> ', eval: myEval });
303 can return an instance of `repl.Recoverable` to the provided callback function:
312 return callback(new repl.Recoverable(e));
328 By default, [`repl.REPLServer`][] instances format output using the
353 To fully customize the output of a [`repl.REPLServer`][] instance pass in a new
358 const repl = require('node:repl');
360 const r = repl.start({ prompt: '> ', eval: myEval, writer: myWriter });
377 * `options` {Object|string} See [`repl.start()`][]
380 Instances of `repl.REPLServer` are created using the [`repl.start()`][] method
384 const repl = require('node:repl');
388 const firstInstance = repl.start(options);
389 const secondInstance = new repl.REPLServer(options);
407 console.log('Received "exit" event from repl!');
420 the default evaluator and the `repl.REPLServer` instance was created with the
428 const repl = require('node:repl');
434 const r = repl.start({ prompt: '> ' });
479 const repl = require('node:repl');
481 const replServer = repl.start({ prompt: '> ' });
562 * `repl` {repl.REPLServer}
570 ## `repl.builtinModules`
580 ## `repl.start([options])`
618 function. An `eval` function can error with `repl.Recoverable` to indicate
639 * `repl.REPL_MODE_SLOPPY` to evaluate expressions in sloppy mode.
640 * `repl.REPL_MODE_STRICT` to evaluate expressions in strict mode. This is
641 equivalent to prefacing every repl statement with `'use strict'`.
646 * `preview` {boolean} Defines if the repl prints autocomplete and output
650 * Returns: {repl.REPLServer}
652 The `repl.start()` method creates and starts a [`repl.REPLServer`][] instance.
657 const repl = require('node:repl');
660 repl.start('$ ');
665 Node.js itself uses the `node:repl` module to provide its own interactive
730 const repl = require('node:repl');
733 repl.start({
741 repl.start({
748 }).listen('/tmp/node-repl-sock');
752 repl.start({
780 [`--no-experimental-repl-await`]: cli.md#--no-experimental-repl-await
787 [`repl.ReplServer`]: #class-replserver
788 [`repl.start()`]: #replstartoptions