REPLServer.prototype.setupHistory - Node documentation
method REPLServer.prototype.setupHistory

Usage in Deno

import { REPLServer } from "node:repl";
REPLServer.prototype.setupHistory(
path: string,
callback: (
err: Error | null,
repl: this,
) => void
,
): void

Initializes a history log file for the REPL instance. When executing the Node.js binary and using the command-line REPL, a history file is initialized by default. However, this is not the case when creating a REPL programmatically. Use this method to initialize a history log file when working with REPL instances programmatically.

Parameters

path: string
callback: (
err: Error | null,
repl: this,
) => void

called when history writes are ready or upon error

Return Type

void