Skip to content

Add deno repl --import=... to import modules at startup and expose their exports #23071

@crowlKats

Description

@crowlKats
$ deno repl --eval-file=jsr:@std/encoding@^0/ascii85         
Error in --eval-file file "jsr:@std/encoding@^0/ascii85": Unsupported scheme "jsr" for module "jsr:@std/encoding@^0/ascii85". Supported schemes: [
    "data",
    "blob",
    "file",
    "http",
    "https",
]

We can't just extend --eval-file, because this evals in the main repl context as a script, exposing all vars, including local variable declarations.

We can however add a --import flag that you pass a specifier to that would be imported, and all the exports of would be added to the module scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    replrelated to the Read-Eval-Print-Loop functionality of Denosuggestionsuggestions for new features (yet to be agreed)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions