Skip to content

--env-file watch #54001

@OliverJAsh

Description

@OliverJAsh

What is the problem this feature will solve?

We already have --env-file and --watch:

$ node --env-file=.env --watch test.js

However, it seems we're missing the ability to watch the env file. The command above will not restart the script when the env file changes.

--watch-path=.env doesn't help either. It does restart the script when the env file changes, however the env file is not loaded again, so the script only has access to the environment variables that were loaded when the command was first ran.

What is the feature you are proposing to solve the problem?

A flag to watch the env file e.g. --watch-env-file.

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    dotenvIssues and PRs related to .env file parsingfeature requestIssues that request new features to be added to Node.js.good first issueIssues that are suitable for first-time contributors.watch-modeIssues and PRs related to watch mode

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions