Skip to content

Commit 134e75a

Browse files
authored
Merge branch 'main' into backport-script
2 parents 1e3f814 + b0edb28 commit 134e75a

File tree

225 files changed

+1115
-1017
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+1115
-1017
lines changed

β€ŽCHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ release.
3535
</tr>
3636
<tr>
3737
<td valign="top">
38-
<b><a href="doc/changelogs/CHANGELOG_V20.md#20.6.0">20.6.0</a></b><br/>
38+
<b><a href="doc/changelogs/CHANGELOG_V20.md#20.6.1">20.6.1</a></b><br/>
39+
<a href="doc/changelogs/CHANGELOG_V20.md#20.6.0">20.6.0</a><br/>
3940
<a href="doc/changelogs/CHANGELOG_V20.md#20.5.1">20.5.1</a><br/>
4041
<a href="doc/changelogs/CHANGELOG_V20.md#20.5.0">20.5.0</a><br/>
4142
<a href="doc/changelogs/CHANGELOG_V20.md#20.4.0">20.4.0</a><br/>

β€ŽMakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,7 @@ FORMAT_CPP_FILES += $(LINT_CPP_FILES)
14231423
# C source codes.
14241424
FORMAT_CPP_FILES += $(wildcard \
14251425
benchmark/napi/*/*.c \
1426+
test/js-native-api/*.h \
14261427
test/js-native-api/*/*.c \
14271428
test/js-native-api/*/*.h \
14281429
test/node-api/*/*.c \

β€Žbenchmark/webstreams/creation.js

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,99 @@
22
const common = require('../common.js');
33
const {
44
ReadableStream,
5+
ReadableStreamDefaultReader,
6+
ReadableStreamBYOBReader,
57
TransformStream,
68
WritableStream,
79
} = require('node:stream/web');
810
const assert = require('assert');
911

1012
const bench = common.createBenchmark(main, {
1113
n: [50e3],
12-
kind: ['ReadableStream', 'TransformStream', 'WritableStream'],
14+
kind: [
15+
'ReadableStream',
16+
'TransformStream',
17+
'WritableStream',
18+
19+
'ReadableStreamDefaultReader',
20+
'ReadableStreamBYOBReader',
21+
22+
'ReadableStream.tee',
23+
],
1324
});
1425

15-
let rs, ws, ts;
26+
let readableStream;
27+
let transformStream;
28+
let writableStream;
29+
let readableStreamDefaultReader;
30+
let readableStreamBYOBReader;
31+
let teeResult;
1632

1733
function main({ n, kind }) {
1834
switch (kind) {
1935
case 'ReadableStream':
2036
bench.start();
2137
for (let i = 0; i < n; ++i)
22-
rs = new ReadableStream();
38+
readableStream = new ReadableStream();
2339
bench.end(n);
2440

2541
// Avoid V8 deadcode (elimination)
26-
assert.ok(rs);
42+
assert.ok(readableStream);
2743
break;
2844
case 'WritableStream':
2945
bench.start();
3046
for (let i = 0; i < n; ++i)
31-
ws = new WritableStream();
47+
writableStream = new WritableStream();
3248
bench.end(n);
3349

3450
// Avoid V8 deadcode (elimination)
35-
assert.ok(ws);
51+
assert.ok(writableStream);
3652
break;
3753
case 'TransformStream':
3854
bench.start();
3955
for (let i = 0; i < n; ++i)
40-
ts = new TransformStream();
56+
transformStream = new TransformStream();
57+
bench.end(n);
58+
59+
// Avoid V8 deadcode (elimination)
60+
assert.ok(transformStream);
61+
break;
62+
case 'ReadableStreamDefaultReader': {
63+
const readers = Array.from({ length: n }, () => new ReadableStream());
64+
65+
bench.start();
66+
for (let i = 0; i < n; ++i)
67+
readableStreamDefaultReader = new ReadableStreamDefaultReader(readers[i]);
68+
bench.end(n);
69+
70+
// Avoid V8 deadcode (elimination)
71+
assert.ok(readableStreamDefaultReader);
72+
break;
73+
}
74+
case 'ReadableStreamBYOBReader': {
75+
const readers = Array.from({ length: n }, () => new ReadableStream({ type: 'bytes' }));
76+
77+
bench.start();
78+
for (let i = 0; i < n; ++i)
79+
readableStreamBYOBReader = new ReadableStreamBYOBReader(readers[i]);
80+
bench.end(n);
81+
82+
// Avoid V8 deadcode (elimination)
83+
assert.ok(readableStreamBYOBReader);
84+
break;
85+
}
86+
case 'ReadableStream.tee': {
87+
const streams = Array.from({ length: n }, () => new ReadableStream());
88+
89+
bench.start();
90+
for (let i = 0; i < n; ++i)
91+
teeResult = streams[i].tee();
4192
bench.end(n);
4293

4394
// Avoid V8 deadcode (elimination)
44-
assert.ok(ts);
95+
assert.ok(teeResult);
4596
break;
97+
}
4698
default:
4799
throw new Error('Invalid kind');
48100
}

β€Žbenchmark/webstreams/pipe-to.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async function main({ n, highWaterMarkR, highWaterMarkW }) {
1818
const rs = new ReadableStream({
1919
highWaterMark: highWaterMarkR,
2020
pull: function(controller) {
21-
if (i++ === n) {
21+
if (i++ < n) {
2222
controller.enqueue(b);
2323
} else {
2424
controller.close();

β€Ždeps/npm/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
One of the following versions of [Node.js](https://nodejs.org/en/download/) must be installed to run **`npm`**:
1111

12-
* `14.x.x` >= `14.17.0`
13-
* `16.x.x` >= `16.13.0`
14-
* `18.0.0` or higher
12+
* `18.x.x` >= `18.17.0`
13+
* `20.5.0` or higher
1514

1615
### Installation
1716

β€Ždeps/npm/docs/content/commands/npm-install-test.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,26 @@ Note: This is NOT honored by other network related commands, eg `dist-tags`,
256256

257257

258258

259+
#### `cpu`
260+
261+
* Default: null
262+
* Type: null or String
263+
264+
Override CPU architecture of native modules to install. Acceptable values
265+
are same as `cpu` field of package.json, which comes from `process.arch`.
266+
267+
268+
269+
#### `os`
270+
271+
* Default: null
272+
* Type: null or String
273+
274+
Override OS of native modules to install. Acceptable values are same as `os`
275+
field of package.json, which comes from `process.platform`.
276+
277+
278+
259279
#### `workspace`
260280

261281
* Default:

β€Ždeps/npm/docs/content/commands/npm-install.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,26 @@ Note: This is NOT honored by other network related commands, eg `dist-tags`,
646646
647647
648648
649+
#### `cpu`
650+
651+
* Default: null
652+
* Type: null or String
653+
654+
Override CPU architecture of native modules to install. Acceptable values
655+
are same as `cpu` field of package.json, which comes from `process.arch`.
656+
657+
658+
659+
#### `os`
660+
661+
* Default: null
662+
* Type: null or String
663+
664+
Override OS of native modules to install. Acceptable values are same as `os`
665+
field of package.json, which comes from `process.platform`.
666+
667+
668+
649669
#### `workspace`
650670
651671
* Default:

β€Ždeps/npm/docs/content/commands/npm-ls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For
2727
example, running `npm ls promzard` in npm's source tree will show:
2828

2929
```bash
30-
npm@10.0.0 /path/to/npm
30+
npm@10.1.0 /path/to/npm
3131
└─┬ [email protected]
3232
└── [email protected]
3333
```

β€Ždeps/npm/docs/content/commands/npm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Note: This command is unaware of workspaces.
1414

1515
### Version
1616

17-
10.0.0
17+
10.1.0
1818

1919
### Description
2020

β€Ždeps/npm/docs/content/using-npm/config.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,16 @@ Run git commit hooks when using the `npm version` command.
345345

346346

347347

348+
#### `cpu`
349+
350+
* Default: null
351+
* Type: null or String
352+
353+
Override CPU architecture of native modules to install. Acceptable values
354+
are same as `cpu` field of package.json, which comes from `process.arch`.
355+
356+
357+
348358
#### `depth`
349359

350360
* Default: `Infinity` if `--all` is set, otherwise `1`
@@ -1038,6 +1048,16 @@ time.
10381048

10391049

10401050

1051+
#### `os`
1052+
1053+
* Default: null
1054+
* Type: null or String
1055+
1056+
Override OS of native modules to install. Acceptable values are same as `os`
1057+
field of package.json, which comes from `process.platform`.
1058+
1059+
1060+
10411061
#### `otp`
10421062

10431063
* Default: null

β€Ždeps/npm/docs/output/commands/npm-install-test.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ <h1 id="npm-install-test">npm-install-test</h1>
142142

143143
<section id="table_of_contents">
144144
<h2 id="table-of-contents">Table of contents</h2>
145-
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
145+
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#cpu"><code>cpu</code></a></li><li><a href="#os"><code>os</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
146146
</section>
147147

148148
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -327,6 +327,20 @@ <h4 id="dry-run"><code>dry-run</code></h4>
327327
<code>dedupe</code>, <code>uninstall</code>, as well as <code>pack</code> and <code>publish</code>.</p>
328328
<p>Note: This is NOT honored by other network related commands, eg <code>dist-tags</code>,
329329
<code>owner</code>, etc.</p>
330+
<h4 id="cpu"><code>cpu</code></h4>
331+
<ul>
332+
<li>Default: null</li>
333+
<li>Type: null or String</li>
334+
</ul>
335+
<p>Override CPU architecture of native modules to install. Acceptable values
336+
are same as <code>cpu</code> field of package.json, which comes from <code>process.arch</code>.</p>
337+
<h4 id="os"><code>os</code></h4>
338+
<ul>
339+
<li>Default: null</li>
340+
<li>Type: null or String</li>
341+
</ul>
342+
<p>Override OS of native modules to install. Acceptable values are same as <code>os</code>
343+
field of package.json, which comes from <code>process.platform</code>.</p>
330344
<h4 id="workspace"><code>workspace</code></h4>
331345
<ul>
332346
<li>Default:</li>

β€Ždeps/npm/docs/output/commands/npm-install.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ <h1 id="npm-install">npm-install</h1>
142142

143143
<section id="table_of_contents">
144144
<h2 id="table-of-contents">Table of contents</h2>
145-
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#algorithm">Algorithm</a></li><li><a href="#see-also">See Also</a></li></ul></div>
145+
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#cpu"><code>cpu</code></a></li><li><a href="#os"><code>os</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#algorithm">Algorithm</a></li><li><a href="#see-also">See Also</a></li></ul></div>
146146
</section>
147147

148148
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -653,6 +653,20 @@ <h4 id="dry-run"><code>dry-run</code></h4>
653653
<code>dedupe</code>, <code>uninstall</code>, as well as <code>pack</code> and <code>publish</code>.</p>
654654
<p>Note: This is NOT honored by other network related commands, eg <code>dist-tags</code>,
655655
<code>owner</code>, etc.</p>
656+
<h4 id="cpu"><code>cpu</code></h4>
657+
<ul>
658+
<li>Default: null</li>
659+
<li>Type: null or String</li>
660+
</ul>
661+
<p>Override CPU architecture of native modules to install. Acceptable values
662+
are same as <code>cpu</code> field of package.json, which comes from <code>process.arch</code>.</p>
663+
<h4 id="os"><code>os</code></h4>
664+
<ul>
665+
<li>Default: null</li>
666+
<li>Type: null or String</li>
667+
</ul>
668+
<p>Override OS of native modules to install. Acceptable values are same as <code>os</code>
669+
field of package.json, which comes from <code>process.platform</code>.</p>
656670
<h4 id="workspace"><code>workspace</code></h4>
657671
<ul>
658672
<li>Default:</li>

β€Ždeps/npm/docs/output/commands/npm-ls.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ <h3 id="description">Description</h3>
160160
the results to only the paths to the packages named. Note that nested
161161
packages will <em>also</em> show the paths to the specified packages. For
162162
example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
163-
<pre><code class="language-bash">npm@10.0.0 /path/to/npm
163+
<pre><code class="language-bash">npm@10.1.0 /path/to/npm
164164
└─┬ [email protected]
165165
└── [email protected]
166166
</code></pre>

β€Ždeps/npm/docs/output/commands/npm.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ <h2 id="table-of-contents">Table of contents</h2>
150150
</code></pre>
151151
<p>Note: This command is unaware of workspaces.</p>
152152
<h3 id="version">Version</h3>
153-
<p>10.0.0</p>
153+
<p>10.1.0</p>
154154
<h3 id="description">Description</h3>
155155
<p>npm is the package manager for the Node JavaScript platform. It puts
156156
modules in place so that node can find them, and manages dependency

0 commit comments

Comments
Β (0)