Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: add process.loadEnvFile and util.parseEnv #51476

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Jan 15, 2024

Introduces 2 new functions to use the default .env parser.

process.loadEnvFile(path)

  • In order to load the .env file in the current directory:
process.loadEnvFile()
  • Load a specific path:
process.loadEnvFile('./development.env')

util.parseEnv(content)

  • In order to parse an existing string:
assert.deepStrictEqual(require('node:util').parseEnv('HELLO=world'), { HELLO: 'world' });

Fixes #51413
Ref #49148


Thank you Sentry for sponsoring this work!

@anonrig anonrig added semver-minor PRs that contain new features and should be released in the next minor version. notable-change PRs with changes that should be highlighted in changelogs. labels Jan 15, 2024
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/startup

Copy link
Contributor

The notable-change PRs with changes that should be highlighted in changelogs. label has been added by @anonrig.

Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Jan 15, 2024
@anonrig anonrig mentioned this pull request Jan 15, 2024
8 tasks
@anonrig anonrig force-pushed the add-load-env-file branch 3 times, most recently from 0c30e62 to 00927c3 Compare January 15, 2024 19:45
@anonrig anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 15, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 15, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a test that validates what happens when the .env file defines a NODE_OPTIONS?

test/parallel/test-util-load-env-file.js Outdated Show resolved Hide resolved
test/parallel/test-util-load-env-file.js Outdated Show resolved Hide resolved
test/parallel/test-util-load-env-file.js Outdated Show resolved Hide resolved
test/parallel/test-util-load-env-file.js Outdated Show resolved Hide resolved
Copy link
Member

@GeoffreyBooth GeoffreyBooth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just reviewed the docs, but 👍 to the general idea. Thanks for implementing this.

doc/api/util.md Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
@GeoffreyBooth GeoffreyBooth added util Issues and PRs related to the built-in util module. process Issues and PRs related to the process subsystem. cli Issues and PRs related to the Node.js command line interface. labels Jan 15, 2024
doc/api/util.md Outdated Show resolved Hide resolved
targos
targos previously requested changes Jan 16, 2024
Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems more logical to me to have it on process, since it has direct effect on process.env. An utility function would only return the parsed result without side effects

lib/util.js Outdated Show resolved Hide resolved
lib/util.js Outdated Show resolved Hide resolved
@anonrig
Copy link
Member Author

anonrig commented Jan 16, 2024

It seems more logical to me to have it on process, since it has direct effect on process.env. An utility function would only return the parsed result without side effects

@targos Process is a global variable. Are you suggesting having process.loadEnvFile()?

@targos
Copy link
Member

targos commented Jan 16, 2024

That's what I'm suggesting, yes.

@arthurfiorette
Copy link

arthurfiorette commented Jan 16, 2024

What about also adding a "register" like import which simply consists of the following file:

import util from 'node:util'
util.loadEnvFile()

which allows it to be used as follows:

import 'node:util/load-env'

Ofc load-env was just a random name I chose. It's similar to how dotenv/register works, which would ease migration to this native node way.

@GeoffreyBooth
Copy link
Member

Ofc load-env was just a random name I chose. It’s similar to how dotenv/register works, which would ease migration to this native node way.

I don’t think “be able to load environment variables from a file in a one-liner” is a high priority. I think we should separate out the loading from the parsing, and this should just be parseEnvFile and it can stay on util. This takes care of the other request that someone had, to be able to load multiple files.

import { parseEnvFile } from 'node:util'
import { dev } from './my-environment.js'

const commonVariables = await readFile('.env', 'utf8')
const environmentSpecificVariables = await readFile(`.${dev ? 'dev' : 'prod' }.env`, 'utf8')
const parsedCommonVariables = parseEnvFile(commonVariables)
const parsedEnvironmentSpecificVariables = parseEnvFile(environmentSpecificVariables)
process.env = { ...process.env, ...parsedCommonVariables, ...parsedEnvironmentSpecificVariables }

Copy link
Member

@MoLow MoLow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I agree it makes sense to move to process

@anonrig anonrig changed the title util: add loadEnvFile programmatic API src: add process.loadEnvFile programmatic API Jan 16, 2024
@anonrig anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 23, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 23, 2024
@nodejs-github-bot nodejs-github-bot merged commit 0056147 into nodejs:main Jan 23, 2024
54 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 0056147

marco-ippolito pushed a commit to marco-ippolito/node that referenced this pull request Feb 2, 2024
PR-URL: nodejs#51476
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
targos pushed a commit that referenced this pull request Feb 15, 2024
PR-URL: #51476
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
marco-ippolito pushed a commit to marco-ippolito/node that referenced this pull request Feb 19, 2024
PR-URL: nodejs#51476
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
marco-ippolito added a commit that referenced this pull request Mar 1, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) #51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) #51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) #51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) #51812
  * add lemire to collaborators (Daniel Lemire) #51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) #51412
  * (SEMVER-MINOR) add server handshake utility (snek) #51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) #51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) #51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) #50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) #50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) #50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) #51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) #51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) #51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) #50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) #51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) #51244

PR-URL: TODO
@marco-ippolito marco-ippolito mentioned this pull request Mar 1, 2024
marco-ippolito added a commit that referenced this pull request Mar 1, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) #51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) #51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) #51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) #51812
  * add lemire to collaborators (Daniel Lemire) #51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) #51412
  * (SEMVER-MINOR) add server handshake utility (snek) #51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) #51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) #51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) #50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) #50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) #50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) #51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) #51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) #51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) #50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) #51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) #51244

PR-URL: #51932
marco-ippolito added a commit that referenced this pull request Mar 1, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) #51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) #51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) #51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) #51812
  * add lemire to collaborators (Daniel Lemire) #51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) #51412
  * (SEMVER-MINOR) add server handshake utility (snek) #51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) #51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) #51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) #50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) #50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) #50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) #51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) #51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) #51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) #50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) #51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) #51244

PR-URL: #51932
marco-ippolito added a commit that referenced this pull request Mar 1, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) #51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) #51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) #51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) #51812
  * add lemire to collaborators (Daniel Lemire) #51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) #51412
  * (SEMVER-MINOR) add server handshake utility (snek) #51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) #51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) #51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) #50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) #50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) #50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) #51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) #51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) #51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) #50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) #51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) #51244

PR-URL: #51932
marco-ippolito added a commit that referenced this pull request Mar 1, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) #51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) #51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) #51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) #51812
  * add lemire to collaborators (Daniel Lemire) #51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) #51412
  * (SEMVER-MINOR) add server handshake utility (snek) #51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) #51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) #51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) #50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) #50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) #50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) #51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) #51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) #51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) #50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) #51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) #51244

PR-URL: #51932
marco-ippolito added a commit that referenced this pull request Mar 1, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) #51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) #51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) #51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) #51812
  * add lemire to collaborators (Daniel Lemire) #51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) #51412
  * (SEMVER-MINOR) add server handshake utility (snek) #51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) #51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) #51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) #50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) #50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) #50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) #51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) #51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) #51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) #50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) #51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) #51244

PR-URL: #51932
marco-ippolito added a commit that referenced this pull request Mar 1, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) #51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) #51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) #51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) #51812
  * add lemire to collaborators (Daniel Lemire) #51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) #51412
  * (SEMVER-MINOR) add server handshake utility (snek) #51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) #51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) #51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) #50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) #50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) #50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) #51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) #51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) #51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) #50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) #51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) #51244

PR-URL: #51932
marco-ippolito added a commit that referenced this pull request Mar 2, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) #51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) #51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) #51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) #51812
  * add lemire to collaborators (Daniel Lemire) #51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) #51412
  * (SEMVER-MINOR) add server handshake utility (snek) #51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) #51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) #51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) #50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) #50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) #50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) #51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) #51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) #51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) #50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) #51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) #51244

PR-URL: #51932
marco-ippolito added a commit that referenced this pull request Mar 5, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) #51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) #51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) #51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) #51812
  * add lemire to collaborators (Daniel Lemire) #51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) #51412
  * (SEMVER-MINOR) add server handshake utility (snek) #51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) #51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) #51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) #50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) #50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) #50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) #51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) #51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) #51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) #50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) #51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) #51244

PR-URL: #51932
marco-ippolito added a commit that referenced this pull request Mar 5, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) #51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) #51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) #51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) #51812
  * add lemire to collaborators (Daniel Lemire) #51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) #51412
  * (SEMVER-MINOR) add server handshake utility (snek) #51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) #51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) #51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) #50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) #50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) #50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) #51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) #51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) #51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) #50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) #51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) #51244

PR-URL: #51932
RafaelGSS pushed a commit that referenced this pull request Mar 6, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) #51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) #51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) #51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) #51812
  * add lemire to collaborators (Daniel Lemire) #51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) #51412
  * (SEMVER-MINOR) add server handshake utility (snek) #51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) #51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) #51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) #50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) #50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) #50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) #51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) #51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) #51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) #50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) #51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) #51244

PR-URL: #51932
jtoar added a commit to redwoodjs/redwood that referenced this pull request Mar 7, 2024
Last change before releasing the minor. This wraps up the env files
feature started in #9961. To
recap on the naming decision a bit, we can't use just "--env-file"
because Node.js seems to parse it no matter what, and since Redwood's
flag operates on suffixes, Node throws a "not found" error. It also
seems to parse "--env-files", with an "s", which seems like a bug. I
opted for "--add-env-files" back when this flag only added additional
env vars, which didn't override existing ones. This is no longer the
case (they override), so I don't want to imply that they don't.
"--load-env-files" seems like the best alternative, and there's a
precedence in the work done in Node.js here which exposes a new
`loadEnvFile` function: nodejs/node#51476.
jtoar added a commit to redwoodjs/redwood that referenced this pull request Mar 7, 2024
Last change before releasing the minor. This wraps up the env files
feature started in #9961. To
recap on the naming decision a bit, we can't use just "--env-file"
because Node.js seems to parse it no matter what, and since Redwood's
flag operates on suffixes, Node throws a "not found" error. It also
seems to parse "--env-files", with an "s", which seems like a bug. I
opted for "--add-env-files" back when this flag only added additional
env vars, which didn't override existing ones. This is no longer the
case (they override), so I don't want to imply that they don't.
"--load-env-files" seems like the best alternative, and there's a
precedence in the work done in Node.js here which exposes a new
`loadEnvFile` function: nodejs/node#51476.
richardlau pushed a commit that referenced this pull request Mar 25, 2024
PR-URL: #51476
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
richardlau pushed a commit that referenced this pull request Mar 25, 2024
PR-URL: #51476
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
@richardlau richardlau mentioned this pull request Mar 25, 2024
rdw-msft pushed a commit to rdw-msft/node that referenced this pull request Mar 26, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) nodejs#51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) nodejs#51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) nodejs#51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) nodejs#51812
  * add lemire to collaborators (Daniel Lemire) nodejs#51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) nodejs#51412
  * (SEMVER-MINOR) add server handshake utility (snek) nodejs#51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) nodejs#51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) nodejs#51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) nodejs#50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) nodejs#50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) nodejs#50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) nodejs#51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) nodejs#51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) nodejs#51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) nodejs#50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) nodejs#51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) nodejs#51244

PR-URL: nodejs#51932
@Burkieboy Burkieboy mentioned this pull request Apr 2, 2024
2 tasks
jcbhmr pushed a commit to jcbhmr/node that referenced this pull request May 15, 2024
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) nodejs#51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) nodejs#51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) nodejs#51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) nodejs#51812
  * add lemire to collaborators (Daniel Lemire) nodejs#51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) nodejs#51412
  * (SEMVER-MINOR) add server handshake utility (snek) nodejs#51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) nodejs#51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) nodejs#51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) nodejs#50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) nodejs#50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) nodejs#50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) nodejs#51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) nodejs#51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) nodejs#51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) nodejs#50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) nodejs#51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) nodejs#51244

PR-URL: nodejs#51932
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. cli Issues and PRs related to the Node.js command line interface. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. process Issues and PRs related to the process subsystem. semver-minor PRs that contain new features and should be released in the next minor version. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a feature to parse .env file by default