Skip to content

REPL .load multiline arrow function expressions #14022

Closed
@rsxdalv

Description

There is no documented way of doing a .load in .editor style, causing multiline expressions (and JavaScript's implicit semicolons within a REPL) to break functions such as this:

const parseXlsx = (file) =>
    getFile(file)
        .then(data => xlsx.read(data))

(After getFile(file), the single line REPL will assume that the expression is done)

Proposal:
Combine .editor and .load into .load-editor or .load-multiline that loads the entire file before executing it. Possible workarounds - requiring the file and using exports, but that's reinventing .load. Alternatively, I'll attempt to minify the output, as that should reduce whitespace that has a special meaning in REPL single-line mode.

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.replIssues and PRs related to the REPL subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions