From f3fcad280477061ab99803875069757ae117a485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Mon, 29 Jan 2024 15:45:38 +0000 Subject: [PATCH 01/20] doc: note that path.normalize deviates from POSIX PR-URL: https://github.com/nodejs/node/pull/51513 Refs: https://github.com/nodejs/node/issues/51345 Reviewed-By: Yagiz Nizipli Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca --- doc/api/path.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/api/path.md b/doc/api/path.md index d58fc044476bb9..c7a999cbb1ec22 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -361,6 +361,14 @@ instance of the platform-specific path segment separator (`/` on POSIX and If the `path` is a zero-length string, `'.'` is returned, representing the current working directory. +On POSIX, the types of normalization applied by this function do not strictly +adhere to the POSIX specification. For example, this function will replace two +leading forward slashes with a single slash as if it was a regular absolute +path, whereas a few POSIX systems assign special meaning to paths beginning with +exactly two forward slashes. Similarly, other substitutions performed by this +function, such as removing `..` segments, may change how the underlying system +resolves the path. + For example, on POSIX: ```js From d4eb03f27fb199625f2aa763c817442fb1ac02b0 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Mon, 29 Jan 2024 17:09:16 -0500 Subject: [PATCH 02/20] meta: add .mailmap entry for lemire PR-URL: https://github.com/nodejs/node/pull/51600 Reviewed-By: Luigi Pinca Reviewed-By: Yagiz Nizipli Reviewed-By: Antoine du Hamel Reviewed-By: Richard Lau --- .mailmap | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index 9535707681f48a..30584cce8b7fb1 100644 --- a/.mailmap +++ b/.mailmap @@ -125,6 +125,7 @@ Daniel Chcouri <333222@gmail.com> Daniel Clifford Daniel Gröber Daniel Gröber +Daniel Lemire Daniel Paulino Daniel Pihlström Daniel Wang diff --git a/README.md b/README.md index a5d6d344910e69..40217ef2339dc2 100644 --- a/README.md +++ b/README.md @@ -390,7 +390,7 @@ For information about the governance of the Node.js project, see * [legendecas](https://github.com/legendecas) - **Chengzhong Wu** <> (he/him) * [lemire](https://github.com/lemire) - - **Daniel Lemire** <> + **Daniel Lemire** <> * [linkgoron](https://github.com/linkgoron) - **Nitzan Uziely** <> * [LiviaMedeiros](https://github.com/LiviaMedeiros) - From 44476be9bfca5427e2be3b63b4629d8eb5b4837a Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Tue, 30 Jan 2024 02:45:49 +0200 Subject: [PATCH 03/20] tools: update lint-md-dependencies to rollup@4.9.6 PR-URL: https://github.com/nodejs/node/pull/51583 Reviewed-By: Luigi Pinca Reviewed-By: Moshe Atlow Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Benjamin Gruenbaum Reviewed-By: Marco Ippolito --- tools/lint-md/package-lock.json | 112 ++++++++++++++++---------------- tools/lint-md/package.json | 2 +- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/tools/lint-md/package-lock.json b/tools/lint-md/package-lock.json index 0365b39686666c..bd9ddba818191a 100644 --- a/tools/lint-md/package-lock.json +++ b/tools/lint-md/package-lock.json @@ -18,7 +18,7 @@ "devDependencies": { "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", - "rollup": "^4.9.5", + "rollup": "^4.9.6", "rollup-plugin-cleanup": "^3.2.1" } }, @@ -101,9 +101,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.5.tgz", - "integrity": "sha512-idWaG8xeSRCfRq9KpRysDHJ/rEHBEXcHuJ82XY0yYFIWnLMjZv9vF/7DOq8djQ2n3Lk6+3qfSH8AqlmHlmi1MA==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz", + "integrity": "sha512-MVNXSSYN6QXOulbHpLMKYi60ppyO13W9my1qogeiAqtjb2yR4LSmfU2+POvDkLzhjYLXz9Rf9+9a3zFHW1Lecg==", "cpu": [ "arm" ], @@ -114,9 +114,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.5.tgz", - "integrity": "sha512-f14d7uhAMtsCGjAYwZGv6TwuS3IFaM4ZnGMUn3aCBgkcHAYErhV1Ad97WzBvS2o0aaDv4mVz+syiN0ElMyfBPg==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.6.tgz", + "integrity": "sha512-T14aNLpqJ5wzKNf5jEDpv5zgyIqcpn1MlwCrUXLrwoADr2RkWA0vOWP4XxbO9aiO3dvMCQICZdKeDrFl7UMClw==", "cpu": [ "arm64" ], @@ -127,9 +127,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.5.tgz", - "integrity": "sha512-ndoXeLx455FffL68OIUrVr89Xu1WLzAG4n65R8roDlCoYiQcGGg6MALvs2Ap9zs7AHg8mpHtMpwC8jBBjZrT/w==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.6.tgz", + "integrity": "sha512-CqNNAyhRkTbo8VVZ5R85X73H3R5NX9ONnKbXuHisGWC0qRbTTxnF1U4V9NafzJbgGM0sHZpdO83pLPzq8uOZFw==", "cpu": [ "arm64" ], @@ -140,9 +140,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.5.tgz", - "integrity": "sha512-UmElV1OY2m/1KEEqTlIjieKfVwRg0Zwg4PLgNf0s3glAHXBN99KLpw5A5lrSYCa1Kp63czTpVll2MAqbZYIHoA==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.6.tgz", + "integrity": "sha512-zRDtdJuRvA1dc9Mp6BWYqAsU5oeLixdfUvkTHuiYOHwqYuQ4YgSmi6+/lPvSsqc/I0Omw3DdICx4Tfacdzmhog==", "cpu": [ "x64" ], @@ -153,9 +153,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.5.tgz", - "integrity": "sha512-Q0LcU61v92tQB6ae+udZvOyZ0wfpGojtAKrrpAaIqmJ7+psq4cMIhT/9lfV6UQIpeItnq/2QDROhNLo00lOD1g==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.6.tgz", + "integrity": "sha512-oNk8YXDDnNyG4qlNb6is1ojTOGL/tRhbbKeE/YuccItzerEZT68Z9gHrY3ROh7axDc974+zYAPxK5SH0j/G+QQ==", "cpu": [ "arm" ], @@ -166,9 +166,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.5.tgz", - "integrity": "sha512-dkRscpM+RrR2Ee3eOQmRWFjmV/payHEOrjyq1VZegRUa5OrZJ2MAxBNs05bZuY0YCtpqETDy1Ix4i/hRqX98cA==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.6.tgz", + "integrity": "sha512-Z3O60yxPtuCYobrtzjo0wlmvDdx2qZfeAWTyfOjEDqd08kthDKexLpV97KfAeUXPosENKd8uyJMRDfFMxcYkDQ==", "cpu": [ "arm64" ], @@ -179,9 +179,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.5.tgz", - "integrity": "sha512-QaKFVOzzST2xzY4MAmiDmURagWLFh+zZtttuEnuNn19AiZ0T3fhPyjPPGwLNdiDT82ZE91hnfJsUiDwF9DClIQ==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.6.tgz", + "integrity": "sha512-gpiG0qQJNdYEVad+1iAsGAbgAnZ8j07FapmnIAQgODKcOTjLEWM9sRb+MbQyVsYCnA0Im6M6QIq6ax7liws6eQ==", "cpu": [ "arm64" ], @@ -192,9 +192,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.5.tgz", - "integrity": "sha512-HeGqmRJuyVg6/X6MpE2ur7GbymBPS8Np0S/vQFHDmocfORT+Zt76qu+69NUoxXzGqVP1pzaY6QIi0FJWLC3OPA==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.6.tgz", + "integrity": "sha512-+uCOcvVmFUYvVDr27aiyun9WgZk0tXe7ThuzoUTAukZJOwS5MrGbmSlNOhx1j80GdpqbOty05XqSl5w4dQvcOA==", "cpu": [ "riscv64" ], @@ -205,9 +205,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.5.tgz", - "integrity": "sha512-Dq1bqBdLaZ1Gb/l2e5/+o3B18+8TI9ANlA1SkejZqDgdU/jK/ThYaMPMJpVMMXy2uRHvGKbkz9vheVGdq3cJfA==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.6.tgz", + "integrity": "sha512-HUNqM32dGzfBKuaDUBqFB7tP6VMN74eLZ33Q9Y1TBqRDn+qDonkAUyKWwF9BR9unV7QUzffLnz9GrnKvMqC/fw==", "cpu": [ "x64" ], @@ -218,9 +218,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.5.tgz", - "integrity": "sha512-ezyFUOwldYpj7AbkwyW9AJ203peub81CaAIVvckdkyH8EvhEIoKzaMFJj0G4qYJ5sw3BpqhFrsCc30t54HV8vg==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.6.tgz", + "integrity": "sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==", "cpu": [ "x64" ], @@ -231,9 +231,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.5.tgz", - "integrity": "sha512-aHSsMnUw+0UETB0Hlv7B/ZHOGY5bQdwMKJSzGfDfvyhnpmVxLMGnQPGNE9wgqkLUs3+gbG1Qx02S2LLfJ5GaRQ==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.6.tgz", + "integrity": "sha512-VD6qnR99dhmTQ1mJhIzXsRcTBvTjbfbGGwKAHcu+52cVl15AC/kplkhxzW/uT0Xl62Y/meBKDZvoJSJN+vTeGA==", "cpu": [ "arm64" ], @@ -244,9 +244,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.5.tgz", - "integrity": "sha512-AiqiLkb9KSf7Lj/o1U3SEP9Zn+5NuVKgFdRIZkvd4N0+bYrTOovVd0+LmYCPQGbocT4kvFyK+LXCDiXPBF3fyA==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.6.tgz", + "integrity": "sha512-J9AFDq/xiRI58eR2NIDfyVmTYGyIZmRcvcAoJ48oDld/NTR8wyiPUu2X/v1navJ+N/FGg68LEbX3Ejd6l8B7MQ==", "cpu": [ "ia32" ], @@ -257,9 +257,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.5.tgz", - "integrity": "sha512-1q+mykKE3Vot1kaFJIDoUFv5TuW+QQVaf2FmTT9krg86pQrGStOSJJ0Zil7CFagyxDuouTepzt5Y5TVzyajOdQ==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.6.tgz", + "integrity": "sha512-jqzNLhNDvIZOrt69Ce4UjGRpXJBzhUBzawMwnaDAwyHriki3XollsewxWzOzz+4yOFDkuJHtTsZFwMxhYJWmLQ==", "cpu": [ "x64" ], @@ -5791,9 +5791,9 @@ } }, "node_modules/rollup": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.5.tgz", - "integrity": "sha512-E4vQW0H/mbNMw2yLSqJyjtkHY9dslf/p0zuT1xehNRqUTBOFMqEjguDvqhXr7N7r/4ttb2jr4T41d3dncmIgbQ==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.6.tgz", + "integrity": "sha512-05lzkCS2uASX0CiLFybYfVkwNbKZG5NFQ6Go0VWyogFTXXbR039UVsegViTntkk4OglHBdF54ccApXRRuXRbsg==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -5806,19 +5806,19 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.9.5", - "@rollup/rollup-android-arm64": "4.9.5", - "@rollup/rollup-darwin-arm64": "4.9.5", - "@rollup/rollup-darwin-x64": "4.9.5", - "@rollup/rollup-linux-arm-gnueabihf": "4.9.5", - "@rollup/rollup-linux-arm64-gnu": "4.9.5", - "@rollup/rollup-linux-arm64-musl": "4.9.5", - "@rollup/rollup-linux-riscv64-gnu": "4.9.5", - "@rollup/rollup-linux-x64-gnu": "4.9.5", - "@rollup/rollup-linux-x64-musl": "4.9.5", - "@rollup/rollup-win32-arm64-msvc": "4.9.5", - "@rollup/rollup-win32-ia32-msvc": "4.9.5", - "@rollup/rollup-win32-x64-msvc": "4.9.5", + "@rollup/rollup-android-arm-eabi": "4.9.6", + "@rollup/rollup-android-arm64": "4.9.6", + "@rollup/rollup-darwin-arm64": "4.9.6", + "@rollup/rollup-darwin-x64": "4.9.6", + "@rollup/rollup-linux-arm-gnueabihf": "4.9.6", + "@rollup/rollup-linux-arm64-gnu": "4.9.6", + "@rollup/rollup-linux-arm64-musl": "4.9.6", + "@rollup/rollup-linux-riscv64-gnu": "4.9.6", + "@rollup/rollup-linux-x64-gnu": "4.9.6", + "@rollup/rollup-linux-x64-musl": "4.9.6", + "@rollup/rollup-win32-arm64-msvc": "4.9.6", + "@rollup/rollup-win32-ia32-msvc": "4.9.6", + "@rollup/rollup-win32-x64-msvc": "4.9.6", "fsevents": "~2.3.2" } }, diff --git a/tools/lint-md/package.json b/tools/lint-md/package.json index 75a5dbaec6f908..aa0f86502c2763 100644 --- a/tools/lint-md/package.json +++ b/tools/lint-md/package.json @@ -16,7 +16,7 @@ "devDependencies": { "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", - "rollup": "^4.9.5", + "rollup": "^4.9.6", "rollup-plugin-cleanup": "^3.2.1" } } From 0f461aad4cbf747fa053714f08e5030ddf019977 Mon Sep 17 00:00:00 2001 From: Duncan Chiu <64763059+duncanchiu409@users.noreply.github.com> Date: Tue, 30 Jan 2024 11:50:39 +1030 Subject: [PATCH 04/20] doc: fix `dns.lookup` and `dnsPromises.lookup` description PR-URL: https://github.com/nodejs/node/pull/51517 Fixes: https://github.com/nodejs/node/issues/51482 Reviewed-By: Paolo Insogna Reviewed-By: Matteo Collina --- doc/api/dns.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/api/dns.md b/doc/api/dns.md index b0ff62c2cd5d1b..00a109937448bf 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -204,8 +204,9 @@ changes: * `options` {integer | Object} * `family` {integer|string} The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons,`'IPv4'` and `'IPv6'` are interpreted as `4` - and `6` respectively. The value `0` indicates that IPv4 and IPv6 addresses - are both returned. **Default:** `0`. + and `6` respectively. The value `0` indicates that either an IPv4 or IPv6 + address is returned. If the value `0` is used with `{ all: true } (see below)`, + both IPv4 and IPv6 addresses are returned. **Default:** `0`. * `hints` {number} One or more [supported `getaddrinfo` flags][]. Multiple flags may be passed by bitwise `OR`ing their values. * `all` {boolean} When `true`, the callback returns all resolved addresses in @@ -953,8 +954,9 @@ added: v10.6.0 * `hostname` {string} * `options` {integer | Object} * `family` {integer} The record family. Must be `4`, `6`, or `0`. The value - `0` indicates that IPv4 and IPv6 addresses are both returned. **Default:** - `0`. + `0` indicates that either an IPv4 or IPv6 address is returned. If the + value `0` is used with `{ all: true }` (see below), both IPv4 and IPv6 + addresses are returned. **Default:** `0`. * `hints` {number} One or more [supported `getaddrinfo` flags][]. Multiple flags may be passed by bitwise `OR`ing their values. * `all` {boolean} When `true`, the `Promise` is resolved with all addresses in From a501315b94a5d6c248afdaa01fcf3ba9d71056fb Mon Sep 17 00:00:00 2001 From: Moshe Atlow Date: Wed, 31 Jan 2024 08:44:33 +0200 Subject: [PATCH 05/20] repl: fix `NO_COLORS` env var is ignored PR-URL: https://github.com/nodejs/node/pull/51568 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Ruben Bridgewater Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca --- lib/repl.js | 2 +- test/parallel/test-repl-envvars.js | 10 +++++----- test/parallel/test-repl-options.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/repl.js b/lib/repl.js index 3effdc7bb82d41..1fbce42888c9a2 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -302,7 +302,7 @@ function REPLServer(prompt, if (options.terminal && options.useColors === undefined) { // If possible, check if stdout supports colors or not. - options.useColors = shouldColorize(options.output) || process.env.NODE_DISABLE_COLORS === undefined; + options.useColors = shouldColorize(options.output); } // TODO(devsnek): Add a test case for custom eval functions. diff --git a/test/parallel/test-repl-envvars.js b/test/parallel/test-repl-envvars.js index 0f02cef8cbd1a8..4efa04072d5fee 100644 --- a/test/parallel/test-repl-envvars.js +++ b/test/parallel/test-repl-envvars.js @@ -13,7 +13,7 @@ const { REPL_MODE_SLOPPY, REPL_MODE_STRICT } = require('repl'); const tests = [ { env: {}, - expected: { terminal: true, useColors: true } + expected: { terminal: true, useColors: false } }, { env: { NODE_DISABLE_COLORS: '1' }, @@ -29,7 +29,7 @@ const tests = [ }, { env: { TERM: 'dumb' }, - expected: { terminal: true, useColors: true } + expected: { terminal: true, useColors: false } }, { env: { TERM: 'dumb', FORCE_COLOR: '1' }, @@ -41,15 +41,15 @@ const tests = [ }, { env: { NODE_NO_READLINE: '0' }, - expected: { terminal: true, useColors: true } + expected: { terminal: true, useColors: false } }, { env: { NODE_REPL_MODE: 'sloppy' }, - expected: { terminal: true, useColors: true, replMode: REPL_MODE_SLOPPY } + expected: { terminal: true, useColors: false, replMode: REPL_MODE_SLOPPY } }, { env: { NODE_REPL_MODE: 'strict' }, - expected: { terminal: true, useColors: true, replMode: REPL_MODE_STRICT } + expected: { terminal: true, useColors: false, replMode: REPL_MODE_STRICT } }, ]; diff --git a/test/parallel/test-repl-options.js b/test/parallel/test-repl-options.js index 953255319cf9eb..faaf461165ef8f 100644 --- a/test/parallel/test-repl-options.js +++ b/test/parallel/test-repl-options.js @@ -55,7 +55,7 @@ assert.strictEqual(r1.output, stream); assert.strictEqual(r1.input, r1.inputStream); assert.strictEqual(r1.output, r1.outputStream); assert.strictEqual(r1.terminal, true); -assert.strictEqual(r1.useColors, r1.terminal); +assert.strictEqual(r1.useColors, false); assert.strictEqual(r1.useGlobal, false); assert.strictEqual(r1.ignoreUndefined, false); assert.strictEqual(r1.replMode, repl.REPL_MODE_SLOPPY); From 8b2836611e26afcb76de71833d0c0d77e47b5e46 Mon Sep 17 00:00:00 2001 From: IlyasShabi <33763729+IlyasShabi@users.noreply.github.com> Date: Wed, 31 Jan 2024 14:09:13 +0100 Subject: [PATCH 06/20] src: support multi-line values for .env file PR-URL: https://github.com/nodejs/node/pull/51289 Reviewed-By: Yagiz Nizipli Reviewed-By: Zeyu "Alex" Yang Reviewed-By: Rafael Gonzaga Reviewed-By: Franziska Hinkelmann --- doc/api/cli.md | 18 ++++++ src/node_dotenv.cc | 97 +++++++++++++++------------------ src/node_dotenv.h | 2 +- test/fixtures/dotenv/valid.env | 25 +++++++++ test/parallel/test-dotenv.js | 14 +++++ test/parallel/util-parse-env.js | 14 ++++- 6 files changed, 114 insertions(+), 56 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 840585765e7fa6..5ba337276597b9 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -666,6 +666,10 @@ of `--enable-source-maps`. Loads environment variables from a file relative to the current directory, @@ -702,6 +706,20 @@ They are omitted from the values. USERNAME="nodejs" # will result in `nodejs` as the value. ``` +Multi-line values are supported: + +```text +MULTI_LINE="THIS IS +A MULTILINE" +# will result in `THIS IS\nA MULTILINE` as the value. +``` + +Export keyword before a key is ignored: + +```text +export USERNAME="nodejs" # will result in `nodejs` as the value. +``` + ### `-e`, `--eval "script"` + +* {Object} + +Returns an object containing commonly used constants for VM operations. + +### `vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER` + + + +> Stability: 1.1 - Active development + +A constant that can be used as the `importModuleDynamically` option to +`vm.Script` and `vm.compileFunction()` so that Node.js uses the default +ESM loader from the main context to load the requested module. + +For detailed information, see +[Support of dynamic `import()` in compilation APIs][]. + ## `vm.createContext([contextObject[, options]])`