method ReplSession.reload
ReplSession.reload(): Promise<string[]>

Reloads the page and brings the modules back, resolving with the names that returned.

The code comes back; what you typed does not. Every file this session loaded is evaluated again — the preloads because the page's own bundle re-runs them, and everything .import or an import statement brought in because this replays those. Bindings are a different thing: let answer = 41 is not code on disk, and bringing it back would make a reload mean "reload, except keep my mistakes".

Return Type

Promise<string[]>

Usage

import { type ReplSession } from "lib/repl/session.ts";