Commit Graph

9851 Commits

Author SHA1 Message Date
Feng Yu
eae75fe635 doc: add err param to fs.cp callback
PR-URL: https://github.com/nodejs/node/pull/53234
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-06-03 22:51:17 +00:00
Feng Yu
f3c714b223 doc: add err param to fs.copyFile callback
PR-URL: https://github.com/nodejs/node/pull/53234
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-06-03 22:51:16 +00:00
Rafael Gonzaga
3ab0499d43
src,permission: --allow-wasi & prevent WASI exec
PR-URL: https://github.com/nodejs/node/pull/53124
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-06-01 13:13:12 +00:00
Keeley Hammond
88d0701e57
doc: reserve 128 for Electron 32
PR-URL: https://github.com/nodejs/node/pull/53203
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-05-31 17:17:07 +00:00
jakecastelli
47c55713ae
doc: add note to ninjia build for macOS using -jn flag
PR-URL: https://github.com/nodejs/node/pull/53187
Fixes: https://github.com/nodejs/node/issues/53176
Refs: https://github.com/nodejs/node/issues/53176
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-30 16:21:56 +00:00
cjihrig
9f6c12413c
test_runner: add snapshot testing
This commit adds a t.assert.snapshot() method that implements
snapshot testing. Serialization uses JSON.stringify() by default,
but users can configure the serialization to meet their needs.

PR-URL: https://github.com/nodejs/node/pull/53169
Fixes: https://github.com/nodejs/node/issues/48260
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2024-05-30 09:07:17 -04:00
cjihrig
851dcddb57
doc: add context.assert docs
When context.assert was added, no docs were added. This commit
adds initial documentation for context.assert because the
snapshot() function requires them.

PR-URL: https://github.com/nodejs/node/pull/53169
Refs: https://github.com/nodejs/node/pull/52860
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2024-05-30 09:07:17 -04:00
cjihrig
90e81aaad7
test_runner: add context.fullName
This commit adds a fullName getter to the TestContext and
SuiteContext classes. This is similar to the existing name getter,
but also includes the name of all ancestor tests/suites.

PR-URL: https://github.com/nodejs/node/pull/53169
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Jacob Smith <jacob@frende.me>
2024-05-30 09:07:17 -04:00
Paolo Insogna
a837886561
net: add new net.server.listen tracing channel
PR-URL: https://github.com/nodejs/node/pull/53136
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2024-05-30 08:40:19 +00:00
Aviv Keller
78485280ca
doc: include ESM import for HTTP
PR-URL: https://github.com/nodejs/node/pull/53165
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
2024-05-30 00:46:42 +00:00
Joyee Cheung
1de215e285 process: add process.getBuiltinModule(id)
`process.getBuiltinModule(id)` provides a way to load built-in modules
in a globally available function. ES Modules that need to support
other environments can use it to conditionally load a Node.js built-in
when it is run in Node.js, without having to deal with the resolution
error that can be thrown by `import` in a non-Node.js environment or
having to use dynamic `import()` which either turns the module into an
asynchronous module, or turns a synchronous API into an asynchronous
one.

```mjs
if (globalThis.process.getBuiltinModule) {
  // Run in Node.js, use the Node.js fs module.
  const fs = globalThis.process.getBuiltinModule('fs');
  // If `require()` is needed to load user-modules, use
  // createRequire()
  const module = globalThis.process.getBuiltinModule('module');
  const require = module.createRequire(import.meta.url);
  const foo = require('foo');
}
```

If `id` specifies a built-in module available in the current Node.js
process, `process.getBuiltinModule(id)` method returns the
corresponding built-in module. If `id` does not correspond to any
built-in module, `undefined` is returned.

`process.getBuiltinModule(id)` accept built-in module IDs that are
recognized by `module.isBuiltin(id)`. Some built-in modules must be
loaded with the `node:` prefix.

The built-in modules returned by `process.getBuiltinModule(id)` are
always the original modules - that is, it's not affected by
`require.cache`.

PR-URL: https://github.com/nodejs/node/pull/52762
Fixes: https://github.com/nodejs/node/issues/52599
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-05-28 20:23:15 +00:00
Joyee Cheung
e0b5deefc0 doc: improve explanation about built-in modules
PR-URL: https://github.com/nodejs/node/pull/52762
Fixes: https://github.com/nodejs/node/issues/52599
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-05-28 20:23:14 +00:00
Moshe Atlow
4796e05cc8
test_runner,doc: align documentation with actual stdout/stderr behavior
PR-URL: https://github.com/nodejs/node/pull/53131
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-05-28 19:44:16 +00:00
Marco Ippolito
8c6d43cc4f 2024-05-28, Version 20.14.0 'Iron' (LTS)
Notable changes:

src,permission:
  * throw async errors on async APIs (Rafael Gonzaga) https://github.com/nodejs/node/pull/52730
test_runner:
  * (SEMVER-MINOR) support forced exit (Colin Ihrig) https://github.com/nodejs/node/pull/52038

PR-URL: https://github.com/nodejs/node/pull/53120
2024-05-28 18:39:46 +02:00
Rafael Gonzaga
897e39a149
doc: mention pm is not enforced when using fd
PR-URL: https://github.com/nodejs/node/pull/53125
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2024-05-27 18:31:28 +00:00
Pop Moore
72a4470688
doc: fix format in esm.md
PR-URL: https://github.com/nodejs/node/pull/53170
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-05-27 19:51:10 +02:00
Deokjin Kim
33d4f29911
doc: fix wrong variable name in example of timers.tick()
Change variable name from `twoSeconds` to `threeSeconds` because
actual value is 3000(ms). And add missing supported timer
value(clearImmediate). Plus, fix typo(implicity -> implicitly).

PR-URL: https://github.com/nodejs/node/pull/53147
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2024-05-27 14:22:45 +00:00
Théo LUDWIG
ff659faeb8
fs: mark recursive cp methods as stable
PR-URL: https://github.com/nodejs/node/pull/53127
Fixes: https://github.com/nodejs/node/issues/44598
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-05-26 23:47:03 +02:00
Deokjin Kim
892d360ba3
doc: fix wrong function name in example of context.plan()
t.subtest -> t.test

Refs: https://github.com/nodejs/node/pull/52860
PR-URL: https://github.com/nodejs/node/pull/53140
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-05-26 15:03:34 +00:00
Alba Mendez
0d7b5a938c
doc: move all TLS-PSK documentation to its section
PR-URL: https://github.com/nodejs/node/pull/35717
Reviewed-By: Rich Trott <rtrott@gmail.com>
2024-05-25 20:33:34 +02:00
Michaël Zasso
7e6d92c485
tools: update ESLint to v9 and use flat config
Closes: https://github.com/nodejs/node/issues/52567
PR-URL: https://github.com/nodejs/node/pull/52780
Fixes: https://github.com/nodejs/node/issues/52567
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-23 19:45:18 +00:00
Rafael Gonzaga
b9ad94b6da
src: fix external module env and kDisableNodeOptionsEnv
PR-URL: https://github.com/nodejs/node/pull/52905
Fixes: https://github.com/nodejs/node/issues/51227
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2024-05-23 18:41:55 +00:00
Vladimir Morozov
98a1ecfc7b
test,doc: enable running embedtest for Windows
PR-URL: https://github.com/nodejs/node/pull/52646
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-05-23 18:33:40 +00:00
Yagiz Nizipli
2aaeaa863c
cli: add NODE_RUN_PACKAGE_JSON_PATH env
PR-URL: https://github.com/nodejs/node/pull/53058
Refs: https://github.com/nodejs/node/issues/52673
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
2024-05-21 13:59:35 +00:00
Richard Lau
d03198712e
2024-05-21, Version 18.20.3 'Hydrogen' (LTS)
Notable changes:

This release fixes a regression introduced in Node.js 18.19.0 where
`http.server.close()` was incorrectly closing idle connections.

A fix has also been included for compiling Node.js from source with
newer versions of Clang.

The list of keys used to sign releases has been synchronized with the
current list from the `main` branch.

Updated dependencies:

- acorn updated to 8.11.3.
- acorn-walk updated to 8.3.2.
- ada updated to 2.7.8.
- c-ares updated to 1.28.1.
- corepack updated to 0.28.0.
- nghttp2 updated to 1.61.0.
- ngtcp2 updated to 1.3.0.
- npm updated to 10.7.0. Includes a fix from npm@10.5.1 to limit the
  number of open connections.
- simdutf updated to 5.2.4.
- zlib updated to 1.3.0.1-motley-7d77fb7.

PR-URL: https://github.com/nodejs/node/pull/53028
2024-05-21 11:57:07 +00:00
Colin Ihrig
a619789ef0
test_runner: support module mocking
This commit adds experimental module mocking to the test runner.

PR-URL: https://github.com/nodejs/node/pull/52848
Fixes: https://github.com/nodejs/node/issues/51164
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2024-05-19 05:09:09 +00:00
Yagiz Nizipli
cb90a316d0
cli: add NODE_RUN_SCRIPT_NAME env to node --run
PR-URL: https://github.com/nodejs/node/pull/53032
Refs: https://github.com/nodejs/node/issues/52673
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-05-19 01:37:25 +00:00
jakecastelli
00550b043b
doc: improve ninja build for --built-in-modules-path
The current ninja build does not work with `--node-builtin-modules-path`
flag without passing `--ninja` as it will use `make` to build from
scratch again.

PR-URL: https://github.com/nodejs/node/pull/53007
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-05-17 14:39:44 +00:00
Michaël Zasso
fac55e3ef9
lib,doc: replace references to import assertions
Use "import attributes" and "type attribute" instead.

PR-URL: https://github.com/nodejs/node/pull/52998
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-05-17 08:07:48 +00:00
Cloyd Lau
b0bd534bce
doc: avoid hiding by navigation bar in anchor jumping
PR-URL: https://github.com/nodejs/node/pull/45131
Fixes: https://github.com/nodejs/node/issues/42286
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-16 19:24:51 +00:00
Deokjin Kim
2693f0916f
doc: remove unavailable youtube link in pull requests
This video(https://www.youtube.com/watch?v=HW0RPaJqm4g) isn't
available anymore. And I couldn't find a proper github code
review tutorial clip yet.

PR-URL: https://github.com/nodejs/node/pull/52982
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2024-05-16 15:44:13 +00:00
Michaël Zasso
28b0a5826b
2024-05-15, Version 22.2.0 (Current)
Notable changes:

cli:
  * (SEMVER-MINOR) allow running wasm in limited vmem with
    --disable-wasm-trap-handler (Joyee Cheung)
    https://github.com/nodejs/node/pull/52766
doc:
  * add pimterry to collaborators (Tim Perry)
    https://github.com/nodejs/node/pull/52874
fs:
  * (SEMVER-MINOR) allow 'withFileTypes' to be used with globs
    (Aviv Keller) https://github.com/nodejs/node/pull/52837
inspector:
  * (SEMVER-MINOR) introduce the `--inspect-wait` flag (Kohei Ueno)
    https://github.com/nodejs/node/pull/52734
lib,src:
  * remove --experimental-policy (Rafael Gonzaga)
    https://github.com/nodejs/node/pull/52583
perf_hooks:
  * (SEMVER-MINOR) add `deliveryType` and `responseStatus` fields
    (Matthew Aitken) https://github.com/nodejs/node/pull/51589
test_runner:
  * (SEMVER-MINOR) support test plans (Colin Ihrig)
    https://github.com/nodejs/node/pull/52860
zlib:
  * (SEMVER-MINOR) expose zlib.crc32() (Joyee Cheung)
    https://github.com/nodejs/node/pull/52692

PR-URL: https://github.com/nodejs/node/pull/52971
2024-05-15 21:21:22 +02:00
Deokjin Kim
139c26b67f
doc: add missing supported timer values in timers.enable()
Some timer values such as `setImmediate` and `clearImmediate` are
missed. And `milliseconds` which is argument of `timers.tick()`
is optional and default is 1.

Refs: https://github.com/nodejs/node/pull/49534#discussion_r1597457356
PR-URL: https://github.com/nodejs/node/pull/52969
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-05-15 16:02:33 +00:00
Marco Ippolito
9807ede6fb
doc: remove reference to AUTHORS file
PR-URL: https://github.com/nodejs/node/pull/52960
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2024-05-14 10:35:52 +00:00
Aviv Keller
29884d1d5c
doc: update hljs with the latest styles
PR-URL: https://github.com/nodejs/node/pull/52911
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
2024-05-13 10:47:45 +00:00
Aras Abbasi
1d7d094a98
lib: add EventSource Client
PR-URL: https://github.com/nodejs/node/pull/51575
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-13 05:32:08 +00:00
Zhenwei Jin
c8a4f70265
assert: add deep equal check for more Error type
PR-URL: https://github.com/nodejs/node/pull/51805
Fixes: https://github.com/nodejs/node/issues/51793
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-05-12 19:46:13 +00:00
Alex Crawford
d272625d54
doc: mention quicker way to build docs
`make doc-only` skips the process of building Node, which speeds
things up considerably for new contributors.

PR-URL: https://github.com/nodejs/node/pull/52937
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-05-12 18:54:03 +00:00
Khafra
e2697c1a64
perf_hooks: add deliveryType and responseStatus fields
PR-URL: https://github.com/nodejs/node/pull/51589
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-05-12 20:02:48 +02:00
Rafael Gonzaga
06619aa058
doc: mention push.followTags config
This has happened in v20.13.0 release. Adding this doc
to prevent edge cases where the releaser will sign and push
but won't be able to promote the release.

PR-URL: https://github.com/nodejs/node/pull/52906
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-12 17:20:51 +00:00
Alois Klink
ca2f874fe3 doc: document pipeline with end option
There is currently no documentation about what the `end` option in
`stream.promises.pipeline` does.

Refs: https://github.com/nodejs/node/pull/40886
Refs: https://github.com/nodejs/node/issues/34805#issuecomment-1345655205
Fixes: https://github.com/nodejs/node/issues/45821
PR-URL: https://github.com/nodejs/node/pull/48970
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-05-12 11:18:40 +02:00
Evan Shortiss
17b5d0bf85
doc: add example for execFileSync method and ref to stdio
Added an example to the `execFileSync` method. This demonstrates how to
handle exceptions and access the stderr and stdio properties that are
attached to the `Error` object in a `catch` block.

Added a link to the detailed stdio section nested under
`child_process.spawn()` from each child_process sync method option
description.

Fixes: https://github.com/nodejs/node/issues/39306
PR-URL: https://github.com/nodejs/node/pull/39412
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-12 07:18:40 +00:00
Kohei Ueno
c0ae3b2373
inspector: introduce the --inspect-wait flag
PR-URL: https://github.com/nodejs/node/pull/52734
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2024-05-11 18:48:30 +00:00
mary marchini
938008622c
doc: add examples and notes to http server.close et al
Add examples to `http` server.close, server.closeAllConnections,
server.closeIdleConnections. Also add notes about usage for both
server.close*Connections libraries.

PR-URL: https://github.com/nodejs/node/pull/49091
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-05-11 20:41:51 +02:00
Adam Jones
6e07a7628a
doc: fix dns.lookup family 0 and all descriptions
PR-URL: https://github.com/nodejs/node/pull/51653
Fixes: https://github.com/nodejs/node/issues/51482
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-11 20:37:30 +02:00
sinkhaha
c4d0229486
doc: update fs.realpath documentation
PR-URL: https://github.com/nodejs/node/pull/48170
Fixes: https://github.com/nodejs/node/issues/45067
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-05-11 16:03:51 +02:00
Mert Can Altin
a27f473c26
doc: update fs read documentation for clarity
PR-URL: https://github.com/nodejs/node/pull/52453
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-05-10 18:04:05 +00:00
Benjamin Gruenbaum
761d2ce43c
doc: watermark string behavior
Documents that we calculate the highWaterMark value
of streams operating on strings using the number of
UTF-16 code units.

Fixes: https://github.com/nodejs/node/issues/52818
PR-URL: https://github.com/nodejs/node/pull/52842
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-05-10 19:58:40 +02:00
Marco Ippolito
dee061a380
doc: exclude commits with baking-for-lts
PR-URL: https://github.com/nodejs/node/pull/52896
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruy Adorno <ruy@vlt.sh>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-05-10 13:34:26 +00:00
Joyee Cheung
77fabfb2ab
cli: allow running wasm in limited vmem with --disable-wasm-trap-handler
By default, Node.js enables trap-handler-based WebAssembly bound
checks. As a result, V8 does not need to insert inline bound checks
int the code compiled from WebAssembly which may speedup WebAssembly
execution significantly, but this optimization requires allocating
a big virtual memory cage (currently 10GB). If the Node.js process
does not have access to a large enough virtual memory address space
due to system configurations or hardware limitations, users won't
be able to run any WebAssembly that involves allocation in this
virtual memory cage and will see an out-of-memory error.

```console
$ ulimit -v 5000000
$ node -p "new WebAssembly.Memory({ initial: 10, maximum: 100 });"
[eval]:1
new WebAssembly.Memory({ initial: 10, maximum: 100 });
^

RangeError: WebAssembly.Memory(): could not allocate memory
    at [eval]:1:1
    at runScriptInThisContext (node:internal/vm:209:10)
    at node:internal/process/execution:118:14
    at [eval]-wrapper:6:24
    at runScript (node:internal/process/execution:101:62)
    at evalScript (node:internal/process/execution:136:3)
    at node:internal/main/eval_string:49:3

```

`--disable-wasm-trap-handler` disables this optimization so that
users can at least run WebAssembly (with a less optimial performance)
when the virtual memory address space available to their Node.js
process is lower than what the V8 WebAssembly memory cage needs.

PR-URL: https://github.com/nodejs/node/pull/52766
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-05-10 16:32:34 +08:00