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

doc: update conditions, add "deno" and "types" #40708

Closed
wants to merge 15 commits into from
12 changes: 9 additions & 3 deletions doc/api/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,17 +612,23 @@ The following condition definitions are currently endorsed by Node.js:
* `"browser"` - any environment which implements a standard subset of global
browser APIs available from JavaScript in web browsers, including the DOM
APIs.
* `"deno"` - indicates a variation for the Deno platform.
guybedford marked this conversation as resolved.
Show resolved Hide resolved
* `"development"` - can be used to define a development-only environment
entry point. _Must always be mutually exclusive with `"production"`._
* `"production"` - can be used to define a production environment entry
point. _Must always be mutually exclusive with `"development"`._
* `"source"` - indicates the original .js source file without minification
guybedford marked this conversation as resolved.
Show resolved Hide resolved
or bundling optimizations, useful for development and debugging workflows.
guybedford marked this conversation as resolved.
Show resolved Hide resolved
* `"types"` - can be used by typing systems to resolve the typing file for
guybedford marked this conversation as resolved.
Show resolved Hide resolved
the given export, possible since the interface should be the same for all
guybedford marked this conversation as resolved.
Show resolved Hide resolved
variations.

The above user conditions can be enabled in Node.js via the
[`--conditions` flag][].

Platform specific conditions such as `"deno"`, `"electron"`, or `"react-native"`
may be used, but while there remain no implementation or integration intent
from these platforms, the above are not explicitly endorsed by Node.js.
guybedford marked this conversation as resolved.
Show resolved Hide resolved
Platform specific conditions such as `"electron"`, or `"react-native"` may
guybedford marked this conversation as resolved.
Show resolved Hide resolved
be used, but while there remain no implementation or integration intent
from these platforms, we do not yet explicitly recommend them.
guybedford marked this conversation as resolved.
Show resolved Hide resolved

New conditions definitions may be added to this list by creating a pull request
to the [Node.js documentation for this section][]. The requirements for listing
Expand Down