Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
2471197
http2: wait for session to finish writing before destroy
lundibundi Dec 7, 2019
e85ca7a
http2: wait for session socket writable end on close/destroy
lundibundi Dec 8, 2019
82af8ac
http2,doc: minor fixes
mildsunrise Apr 27, 2020
bfce0eb
Revert "http2: streamline OnStreamRead streamline memory accounting"
Trott Jul 11, 2020
b732c92
http2: use and support non-empty DATA frame with END_STREAM flag
clshortfuse Jun 14, 2020
f10d721
http: reset headers timeout on headers complete
ronag Jul 31, 2020
fb9b66b
doc: fix typos in n-api, tls and worker_threads
jucke Jul 18, 2020
b644ab6
doc: fix line length in worker_threads.md
jucke Jul 18, 2020
c8a7789
http2: avoid unnecessary buffer resize
lundibundi Jul 22, 2020
70768ce
repl: give repl entries unique names
bmeck Jul 14, 2020
12d76b8
tls: reset secureConnecting on client socket
davedoesdev May 2, 2020
02787ce
test: add ALPNProtocols option to clientOptions
lpinca Oct 3, 2020
decfc2a
fs: add .ref() and .unref() methods to watcher classes
rickyes Apr 28, 2020
8a10916
stream: destroy wrapped streams on error
ronag Jun 28, 2020
d477e2e
http: only set keep-alive when not exists
atian25 Oct 13, 2020
cce4645
http: added scheduling option to http agent
delvedor May 7, 2020
9eb1fa1
module: named exports for CJS via static analysis
guybedford May 15, 2020
6ca8fb5
module: refine module type mismatch error cases
guybedford Sep 30, 2020
a18d0df
module: update to cjs-module-lexer@0.4.0
guybedford Oct 4, 2020
7510667
doc: rename module pages
aduh95 Aug 7, 2020
7c1700e
doc: move package config docs to separate page
aduh95 Aug 7, 2020
d6a13a9
doc: document support for package.json fields
aduh95 Aug 7, 2020
41af927
module: exports pattern support
guybedford Aug 12, 2020
5f0b157
doc: edit subpath export patterns introduction
Trott Sep 18, 2020
5330930
doc: refine require/import conditions constraints
guybedford Sep 23, 2020
f507ca9
doc: packages docs feedback
guybedford Sep 27, 2020
9197a66
doc: copyedit packages.md
Trott Sep 30, 2020
a7e66b6
doc: fix conditional exports flag removal version
aduh95 Sep 30, 2020
66f8730
doc: add history entry for exports patterns
aduh95 Sep 29, 2020
985b96a
doc,esm: add history support info
aduh95 Sep 28, 2020
1ff956f
module: remove experimental modules warning
guybedford Feb 26, 2020
1f34230
doc,esm: document experimental warning removal
aduh95 Oct 22, 2020
0f757bc
esm: use "node:" namespace for builtins
guybedford Sep 28, 2020
68c5ee4
doc: update fs promise-based examples
richardlau Oct 22, 2020
a9a606f
lib: use full URL to GitHub issues in comments
Trott Aug 8, 2020
f22672d
errors: improve ERR_INVALID_OPT_VALUE error
lundibundi Aug 7, 2020
44c739c
deps: V8: cherry-pick 6be2f6e26e8d
Sep 4, 2020
607f3c5
test: fix comment about DNS lookup test
tniessen Sep 6, 2020
85c47d7
doc: avoid double-while sentence in perf_hooks.md
Trott Sep 6, 2020
992af4e
module: fix specifier resolution option value
himself65 Sep 8, 2020
5405e62
deps: update to uvwasi 0.0.11
cjihrig Sep 8, 2020
548137f
errors: simplify ERR_REQUIRE_ESM message generation
Trott Sep 9, 2020
884755f
doc: simplify circular dependencies text in modules.md
Trott Sep 9, 2020
c3e1bf7
test: add wasi readdir() test
cjihrig Sep 1, 2020
d938e85
n-api: add more property defaults
Flarna Sep 15, 2020
11b10d7
tools,doc: upgrade dependencies
aduh95 Sep 17, 2020
f297174
tools,doc: enforce alphabetical order for md refs
aduh95 Sep 17, 2020
bc7da0c
tools: ignore build folder when checking links
Sep 23, 2020
cc11464
deps: upgrade to c-ares v1.16.1
codebytere Sep 24, 2020
b0e43c7
doc: add gpg key export directions to releases doc
danielleadams Sep 22, 2020
cf07a86
deps: upgrade to libuv 1.40.0
cjihrig Sep 25, 2020
fdc67eb
test: replace annonymous functions with arrow
PoojaDurgad Aug 25, 2020
a9ce9b2
tools: update ESLint to 7.10.0
cjihrig Sep 26, 2020
ae14923
tools: exclude gyp from markdown link checker
targos Sep 30, 2020
2e766a6
console: add Symbol.toStringTag property
Leko Sep 28, 2020
c192af6
doc: unhide resolver spec
guybedford Sep 26, 2020
42c0dfc
doc: importable node protocol URLs
bmeck Sep 30, 2020
8be289e
doc: update contact information for richardlau
richardlau Oct 1, 2020
edf3fbb
doc: update contact information for @BethGriggs
BethGriggs Oct 1, 2020
cd80195
src: make MakeCallback() check can_call_into_js before getting method
addaleax Sep 30, 2020
a6f58c0
crypto: set env values in KeyObject Deserialize method
ThakurKarthik Sep 28, 2020
e70b052
src: remove invalid ToLocalChecked in EmitBeforeExit
addaleax Oct 3, 2020
0a1474d
deps: update llhttp to 2.1.3
indutny Sep 30, 2020
19d7113
fs: simplify realpathSync
himself65 Sep 29, 2020
370f8e3
doc: update sxa's email address to Red Hat from IBM
Oct 1, 2020
76f7601
module: fix builtin reexport tracing
guybedford Oct 4, 2020
b5f7525
doc: update AUTHORS list
addaleax Sep 21, 2020
0955267
tools: add missing uv_setup_argv() calls
addaleax Oct 4, 2020
ade27b7
src: use env->ThrowUVException in pipe_wrap
jasnell Oct 4, 2020
7f8834f
src: more idiomatic error pattern in node_wasi
jasnell Oct 4, 2020
ad7281b
lib: use remaining typed arrays from primordials
targos Sep 28, 2020
6952c45
doc: add aduh95 to collaborators
aduh95 Oct 7, 2020
5faaa60
n-api: support for object freeze/seal
codebytere Sep 26, 2020
dec004f
src: expose v8::Isolate setup callbacks
codebytere Oct 5, 2020
2d5393b
src: fix freeing unintialized pointer bug in ParseSoaReply
AasthaGupta Oct 4, 2020
48bc3fc
build: improved release lint error message
codebytere Oct 6, 2020
6efa140
lib: change http client path assignment
dekinderfiets Oct 5, 2020
fb9bb05
doc: fix util.inspect change history
aduh95 Oct 6, 2020
42c4795
doc: use sentence case for class property
Trott Oct 7, 2020
f3a0457
build: fuzzer that targets node::LoadEnvironment()
DavidKorczynski Aug 19, 2020
05db4b8
doc: improve SIGINT error text
Trott Oct 8, 2020
992355c
doc: simplify wording in tracing APIs doc
PoojaDurgad Oct 8, 2020
b741f2f
src: move node_process to modern THROW_ERR*
jasnell Oct 2, 2020
e9bee39
src: move node_contextify to modern THROW_ERR_*
jasnell Oct 2, 2020
1173efc
tools: bump cpplint.py to 1.4.6
Trott Oct 9, 2020
adf4f90
tools: refloat 7 Node.js patches to cpplint.py
Trott Oct 9, 2020
a0b541c
doc: use kbd element in process doc
Trott Oct 10, 2020
5fea51b
doc: add PoojaDurgad as a triager
PoojaDurgad Sep 11, 2020
a3e8829
inspector: do not hardcode Debugger.CallFrameId in tests
dgozman Oct 9, 2020
42f64eb
crypto: update certdata to NSS 3.56
codebytere Oct 7, 2020
a9ac754
doc: add symlink information for process.execpath
PoojaDurgad Oct 10, 2020
bfff4fc
doc: revise description of process.ppid
PoojaDurgad Oct 10, 2020
42a587f
doc: use test username instead of real
PoojaDurgad Oct 12, 2020
df52814
doc: document Buffer.concat may use internal pool
puzpuzpuz Oct 7, 2020
a93ca2d
n-api: revert change to finalization
mhdawson Oct 23, 2020
354f358
module: use Wasm CJS lexer when available
guybedford Oct 10, 2020
7a98961
esm: fix hook mistypes and links to types
DerekNonGeneric Jul 7, 2020
ea23939
module: cjs-module-lexer@0.4.1 big endian fix
guybedford Oct 13, 2020
d7f0e3e
deps: update to cjs-module-lexer@0.4.3
guybedford Oct 21, 2020
5b8d3c7
deps: upgrade to cjs-module-lexer@0.5.0
guybedford Oct 29, 2020
bdcc77b
deps: update to cjs-module-lexer@0.5.2
guybedford Oct 31, 2020
6539cf2
deps: upgrade to cjs-module-lexer@1.0.0
guybedford Nov 2, 2020
d991200
doc: error code fix in resolver spec
guybedford Aug 31, 2020
1a8f3a8
doc: copyedit esm.md
Trott Sep 29, 2020
b50b34b
doc: put release script specifics in details
MylesBorins Sep 18, 2020
77555d8
doc: put landing specifics in details tag
Trott Sep 25, 2020
18f01dd
repl: improve static import error message in repl
MylesBorins May 27, 2020
f0b06b6
doc: move module core module doc to separate page
aduh95 Aug 7, 2020
7dc3b74
doc: add ESM examples in `module` API doc page
aduh95 Aug 22, 2020
b4941cf
doc: make minor improvements to module.md
Trott Sep 6, 2020
79f3c32
doc: fix broken links in modules.md
Trott Sep 14, 2020
1cd1d01
doc: move package.import content higher
MylesBorins Oct 7, 2020
9024436
crypto: fix KeyObject garbage collection
addaleax Oct 3, 2020
b78a1a1
doc: update releaser in v12.18.4 changelog
BethGriggs Sep 15, 2020
c6eb0b6
benchmark: ignore build artifacts for napi addons
richardlau Nov 4, 2020
b484732
events: assume an EventEmitter if emitter.on is a function
lpinca Oct 26, 2020
d84392f
2020-11-24, Version 12.20.0 'Erbium' (LTS)
MylesBorins Nov 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: copyedit packages.md
Some minor adjustments, mostly moving things to present tense and
avoiding the ambiguity of _may_.

Refs: #35370 (comment)

Backport-PR-URL: #35757
PR-URL: #35427
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and MylesBorins committed Nov 16, 2020
commit 9197a6651d2a6b401a09287438f3f78db3ad3925
52 changes: 26 additions & 26 deletions doc/api/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ import 'commonjs-package/src/index.mjs';
// Loaded as ES module since .mjs is always loaded as ES module.
```

The `.mjs` and `.cjs` extensions may be used to mix types within the same
The `.mjs` and `.cjs` extensions can be used to mix types within the same
package:

* Within a `"type": "module"` package, Node.js can be instructed to
Expand All @@ -106,7 +106,7 @@ package:
### `--input-type` flag

Strings passed in as an argument to `--eval` (or `-e`), or piped to `node` via
`STDIN`, will be treated as [ES modules][] when the `--input-type=module` flag
`STDIN`, are treated as [ES modules][] when the `--input-type=module` flag
is set.

```bash
Expand Down Expand Up @@ -134,7 +134,7 @@ their package.

If both [`"exports"`][] and [`"main"`][] are defined, the [`"exports"`][] field
takes precedence over [`"main"`][]. [`"exports"`][] are not specific to ES
modules or CommonJS; [`"main"`][] will be overridden by [`"exports"`][] if it
modules or CommonJS; [`"main"`][] is overridden by [`"exports"`][] if it
exists. As such [`"main"`][] cannot be used as a fallback for CommonJS but it
can be used as a fallback for legacy versions of Node.js that do not support the
[`"exports"`][] field.
Expand Down Expand Up @@ -188,13 +188,13 @@ Alternatively a project could choose to export entire folders:
```

As a last resort, package encapsulation can be disabled entirely by creating an
export for the root of the package `"./*": "./*"`. This will expose every file
export for the root of the package `"./*": "./*"`. This exposes every file
in the package at the cost of disabling the encapsulation and potential tooling
benefits this provides. As the ES Module loader in Node.js enforces the use of
[the full specifier path][], exporting the root rather than being explicit
about entry is less expressive than either of the prior examples. Not only
will encapsulation be lost but module consumers will be unable to
`import feature from 'my-mod/feature'` as they will need to provide the full
is encapsulation lost but module consumers are unable to
`import feature from 'my-mod/feature'` as they need to provide the full
path `import feature from 'my-mod/feature/index.js`.

### Main entry point export
Expand All @@ -209,9 +209,9 @@ To set the main entry point for a package, it is advisable to define both
}
```

When defining the [`"exports"`][] field, all subpaths of the package will be
When the [`"exports"`][] field is defined, all subpaths of the package are
encapsulated and no longer available to importers. For example,
`require('pkg/subpath.js')` would throw an [`ERR_PACKAGE_PATH_NOT_EXPORTED`][]
`require('pkg/subpath.js')` throws an [`ERR_PACKAGE_PATH_NOT_EXPORTED`][]
error.

This encapsulation of exports provides more reliable guarantees
Expand Down Expand Up @@ -343,20 +343,20 @@ For example, a package that wants to provide different ES module exports for

Node.js supports the following conditions out of the box:

* `"import"` - matched when the package is loaded via `import` or
* `"import"` - matches when the package is loaded via `import` or
`import()`, or via any top-level import or resolve operation by the
ECMAScript module loader. Applies regardless of the module format of the
target file. _Always mutually exclusive with `"require"`._
* `"require"` - matched when the package is loaded via `require()`. The
* `"require"` - matches when the package is loaded via `require()`. The
referenced file should be loadable with `require()` although the condition
will be matched regardless of the module format of the target file. Expected
matches regardless of the module format of the target file. Expected
formats include CommonJS, JSON, and native addons but not ES modules as
`require()` doesn't support them. _Always mutually exclusive with
`"import"`._
* `"node"` - matched for any Node.js environment. Can be a CommonJS or ES
* `"node"` - matches for any Node.js environment. Can be a CommonJS or ES
module file. _This condition should always come after `"import"` or
`"require"`._
* `"default"` - the generic fallback that will always match. Can be a CommonJS
* `"default"` - the generic fallback that always matches. Can be a CommonJS
or ES module file. _This condition should always come last._

Within the [`"exports"`][] object, key order is significant. During condition
Expand All @@ -365,9 +365,9 @@ entries. _The general rule is that conditions should be from most specific to
least specific in object order_.

Other conditions such as `"browser"`, `"electron"`, `"deno"`, `"react-native"`,
etc. are unknown to, and thus ignored by Node.js. Runtimes or tools other than
Node.js may use them at their discretion. Further restrictions, definitions, or
guidance on condition names may occur in the future.
etc., are unknown to Node.js, and thus ignored. Runtimes or tools other than
Node.js can use them at their discretion. Further restrictions, definitions, or
guidance on condition names might occur in the future.

Using the `"import"` and `"require"` conditions can lead to some hazards,
which are further explained in [the dual CommonJS/ES module packages section][].
Expand Down Expand Up @@ -534,13 +534,13 @@ when using transpilation via tools like [Babel][] or [`esm`][].
First, the hazard described in the previous section occurs when a package
contains both CommonJS and ES module sources and both sources are provided for
use in Node.js, either via separate main entry points or exported paths. A
package could instead be written where any version of Node.js receives only
CommonJS sources, and any separate ES module sources the package may contain
could be intended only for other environments such as browsers. Such a package
package might instead be written where any version of Node.js receives only
CommonJS sources, and any separate ES module sources the package might contain
are intended only for other environments such as browsers. Such a package
would be usable by any version of Node.js, since `import` can refer to CommonJS
files; but it would not provide any of the advantages of using ES module syntax.

A package could also switch from CommonJS to ES module syntax in a [breaking
A package might also switch from CommonJS to ES module syntax in a [breaking
change](https://semver.org/) version bump. This has the disadvantage that the
newest version of the package would only be usable in ES module-supporting
versions of Node.js.
Expand Down Expand Up @@ -669,7 +669,7 @@ the package’s management of state is carefully isolated (or the package is
stateless).

The reason that state is an issue is because both the CommonJS and ES module
versions of the package may get used within an application; for example, the
versions of the package might get used within an application; for example, the
user’s application code could `import` the ES module version while a dependency
`require`s the CommonJS version. If that were to occur, two copies of the
package would be loaded in memory and therefore two separate states would be
Expand Down Expand Up @@ -751,7 +751,7 @@ conditional exports for consumers could be to add an export, e.g.
## Node.js `package.json` field definitions

This section describes the fields used by the Node.js runtime. Other tools (such
as [npm](https://docs.npmjs.com/creating-a-package-json-file)) may use
as [npm](https://docs.npmjs.com/creating-a-package-json-file)) use
additional fields which are ignored by Node.js and not documented here.

The following fields in `package.json` files are used in Node.js:
Expand All @@ -761,7 +761,7 @@ The following fields in `package.json` files are used in Node.js:
* [`"type"`][] - The package type determining whether to load `.js` files as
CommonJS or ES modules.
* [`"exports"`][] - Package exports and conditional exports. When present,
limits which submodules may be loaded from within the package.
limits which submodules can be loaded from within the package.
* [`"main"`][] - The default module when loading the package, if exports is not
specified, and in versions of Node.js prior to the introduction of exports.
* [`"imports"`][] - Package imports, for use by modules within the package
Expand All @@ -787,7 +787,7 @@ changes:
```

The `"name"` field defines your package’s name. Publishing to the
_npm_ registry may require a name that satisfies
_npm_ registry requires a name that satisfies
[certain requirements](https://docs.npmjs.com/files/package.json#name).

The `"name"` field can be used in addition to the [`"exports"`][] field to
Expand All @@ -805,10 +805,10 @@ changes:

* Type: {string}

The `"type"` field defines the module format that Node.js will use for all
The `"type"` field defines the module format that Node.js uses for all
`.js` files that have that `package.json` file as their nearest parent.

Files ending with `.js` will be loaded as ES modules when the nearest parent
Files ending with `.js` are loaded as ES modules when the nearest parent
`package.json` file contains a top-level field `"type"` with a value of
`"module"`.

Expand Down