MCPcopy Index your code
hub / github.com/nodejs/node / startNewREPLServer

Function startNewREPLServer

test/common/repl.js:6–23  ·  view source on GitHub ↗
(replOpts = {})

Source from the content-addressed store, hash-verified

4const repl = require('node:repl');
5
6function startNewREPLServer(replOpts = {}) {
7 const input = new ArrayStream();
8 const output = new ArrayStream();
9
10 output.accumulator = '';
11 output.write = (data) => (output.accumulator += `${data}`.replaceAll('\r', ''));
12
13 const replServer = repl.start({
14 prompt: '',
15 input,
16 output,
17 terminal: true,
18 allowBlockingCompletions: true,
19 ...replOpts,
20 });
21
22 return { replServer, input, output };
23}
24
25module.exports = { startNewREPLServer };

Calls 1

startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…