Skip to content

Add --use-env-proxy to NODE_OPTIONS #59100

@silverwind

Description

@silverwind

#57165 added the NODE_USE_ENV_PROXY environment variable, but the problem with such a variable is that it can not be controlled by the script itself via hashbang without writing into process.env which is dirty and not guaranteed to work depending on the implementation.

Therefor I suggest to also support it as a CLI flag --use-env-proxy and via NODE_OPTIONS=--use-env-proxy, enabling such hashbangs:

#!/usr/bin/env -S node --use-env-proxy

As for precedence, I suggest taking the value of NODE_USE_ENV_PROXY first if present, then fall back to --use-env-proxy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions