Skip to content

Compare with REPL, "node -p" & "node -e" has different default imports packages  #4069

Description

@rufushuang

When in REPL, we can use packages such as fs, vm directly by default.

But in "node -p"/"node -e", must require these packages manually

node -p "fs"

returns "fs is not defined"

This makes command line script running such a pain...

Try "node -p", then "not defined" one found, and then require the missing package manually. Repeat this again and again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.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