Skip to content

Handle the case when node called with the "-e" argument #2163

@atleta

Description

@atleta

When you call node with the -e argument and supply the script (commands) to execute on the command line then the script parameter will be missing from process.argv (at index 1) so automatic parsing ({from: 'node'}) will fail.

As far as I can see this case can be handled by looking into process.execArgv and checking for the presence of the -e or --eval option.

(One might use this option to run non-trivial scripts e.g. when calling a node process in a docker container.)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions