| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7c1700e commit d6a13a9
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1357,13 +1357,13 @@ An invalid or unknown file encoding was passed. | |||
| 1357 | 1357 | <a id="ERR_INVALID_PACKAGE_CONFIG"></a> | |
| 1358 | 1358 | ### `ERR_INVALID_PACKAGE_CONFIG` | |
| 1359 | 1359 | ||
| 1360 | - An invalid `package.json` file was found which failed parsing. | ||
| 1360 | + An invalid [`package.json`][] file was found which failed parsing. | ||
| 1361 | 1361 | ||
| 1362 | 1362 | <a id="ERR_INVALID_PACKAGE_TARGET"></a> | |
| 1363 | 1363 | ### `ERR_INVALID_PACKAGE_TARGET` | |
| 1364 | 1364 | ||
| 1365 | - The `package.json` [exports][] field contains an invalid target mapping value | ||
| 1366 | - for the attempted module resolution. | ||
| 1365 | + The `package.json` [`"exports"`][] field contains an invalid target mapping | ||
| 1366 | + value for the attempted module resolution. | ||
| 1367 | 1367 | ||
| 1368 | 1368 | <a id="ERR_INVALID_PERFORMANCE_MARK"></a> | |
| 1369 | 1369 | ### `ERR_INVALID_PERFORMANCE_MARK` | |
@@ -1686,13 +1686,13 @@ A given value is out of the accepted range. | |||
| 1686 | 1686 | <a id="ERR_PACKAGE_IMPORT_NOT_DEFINED"></a> | |
| 1687 | 1687 | ### `ERR_PACKAGE_IMPORT_NOT_DEFINED` | |
| 1688 | 1688 | ||
| 1689 | - The `package.json` ["imports" field][] does not define the given internal | ||
| 1689 | + The `package.json` [`"imports"`][] field does not define the given internal | ||
| 1690 | 1690 | package specifier mapping. | |
| 1691 | 1691 | ||
| 1692 | 1692 | <a id="ERR_PACKAGE_PATH_NOT_EXPORTED"></a> | |
| 1693 | 1693 | ### `ERR_PACKAGE_PATH_NOT_EXPORTED` | |
| 1694 | 1694 | ||
| 1695 | - The `package.json` [exports][] field does not export the requested subpath. | ||
| 1695 | + The `package.json` [`"exports"`][] field does not export the requested subpath. | ||
| 1696 | 1696 | Because exports are encapsulated, private internal modules that are not exported | |
| 1697 | 1697 | cannot be imported through the package resolution, unless using an absolute URL. | |
| 1698 | 1698 | ||
@@ -2057,7 +2057,7 @@ signal (such as [`subprocess.kill()`][]). | |||
| 2057 | 2057 | ||
| 2058 | 2058 | `import` a directory URL is unsupported. Instead, | |
| 2059 | 2059 | [self-reference a package using its name][] and [define a custom subpath][] in | |
| 2060 | - the `"exports"` field of the `package.json` file. | ||
| 2060 | + the [`"exports"`][] field of the [`package.json`][] file. | ||
| 2061 | 2061 | ||
| 2062 | 2062 | <!-- eslint-skip --> | |
| 2063 | 2063 | ```js | |
@@ -2529,7 +2529,8 @@ closed. | |||
| 2529 | 2529 | [crypto digest algorithm]: crypto.html#crypto_crypto_gethashes | |
| 2530 | 2530 | [domains]: domain.html | |
| 2531 | 2531 | [event emitter-based]: events.html#events_class_eventemitter | |
| 2532 | - [exports]: packages.html#packages_package_entry_points | ||
| 2532 | + [`package.json`]: packages.html#packages_node_js_package_json_field_definitions | ||
| 2533 | + [`"exports"`]: packages.html#packages_exports | ||
| 2533 | 2534 | [file descriptors]: https://en.wikipedia.org/wiki/File_descriptor | |
| 2534 | 2535 | [policy]: policy.html | |
| 2535 | 2536 | [stream-based]: stream.html | |
@@ -2539,4 +2540,4 @@ closed. | |||
| 2539 | 2540 | [vm]: vm.html | |
| 2540 | 2541 | [self-reference a package using its name]: packages.html#packages_self_referencing_a_package_using_its_name | |
| 2541 | 2542 | [define a custom subpath]: packages.html#packages_subpath_exports | |
| 2542 | - ["imports" field]: packages.html#packages_internal_package_imports | ||
| 2543 | + [`"imports"`]: packages.html#packages_imports | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,7 +55,7 @@ specifier resolution, and default behavior. | |||
| 55 | 55 | ||
| 56 | 56 | Node.js treats JavaScript code as CommonJS modules by default. | |
| 57 | 57 | Authors can tell Node.js to treat JavaScript code as ECMAScript modules | |
| 58 | - via the `.mjs` file extension, the `package.json` `"type"` field, or the | ||
| 58 | + via the `.mjs` file extension, the `package.json` [`"type"`][] field, or the | ||
| 59 | 59 | `--input-type` flag. See | |
| 60 | 60 | [Modules: Packages](packages.html#packages_determining_module_system) for more | |
| 61 | 61 | details. | |
@@ -260,9 +260,9 @@ can either be an URL-style relative path like `'./file.mjs'` or a package name | |||
| 260 | 260 | like `'fs'`. | |
| 261 | 261 | ||
| 262 | 262 | Like in CommonJS, files within packages can be accessed by appending a path to | |
| 263 | - the package name; unless the package’s `package.json` contains an `"exports"` | ||
| 264 | - field, in which case files within packages need to be accessed via the path | ||
| 265 | - defined in `"exports"`. | ||
| 263 | + the package name; unless the package’s [`package.json`][] contains an | ||
| 264 | + [`"exports"`][] field, in which case files within packages need to be accessed | ||
| 265 | + via the path defined in [`"exports"`][]. | ||
| 266 | 266 | ||
| 267 | 267 | ```js | |
| 268 | 268 | import { sin, cos } from 'geometry/trigonometry-functions.mjs'; | |
@@ -1223,3 +1223,6 @@ success! | |||
| 1223 | 1223 | [6.1.7 Array Index]: https://tc39.es/ecma262/#integer-index | |
| 1224 | 1224 | [Top-Level Await]: https://github.com/tc39/proposal-top-level-await | |
| 1225 | 1225 | [Core modules]: modules.html#modules_core_modules | |
| 1226 | + [`package.json`]: packages.html#packages_node_js_package_json_field_definitions | ||
| 1227 | + [`"exports"`]: packages.html#packages_exports | ||
| 1228 | + [`"type"`]: packages.html#packages_type | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -391,8 +391,8 @@ directories, and then provide a single entry point to those directories. | |||
| 391 | 391 | There are three ways in which a folder may be passed to `require()` as | |
| 392 | 392 | an argument. | |
| 393 | 393 | ||
| 394 | - The first is to create a `package.json` file in the root of the folder, | ||
| 395 | - which specifies a `main` module. An example `package.json` file might | ||
| 394 | + The first is to create a [`package.json`][] file in the root of the folder, | ||
| 395 | + which specifies a `main` module. An example [`package.json`][] file might | ||
| 396 | 396 | look like this: | |
| 397 | 397 | ||
| 398 | 398 | ```json | |
@@ -406,10 +406,10 @@ If this was in a folder at `./some-library`, then | |||
| 406 | 406 | ||
| 407 | 407 | This is the extent of the awareness of `package.json` files within Node.js. | |
| 408 | 408 | ||
| 409 | - If there is no `package.json` file present in the directory, or if the | ||
| 410 | - `'main'` entry is missing or cannot be resolved, then Node.js | ||
| 409 | + If there is no [`package.json`][] file present in the directory, or if the | ||
| 410 | + [`"main"`][] entry is missing or cannot be resolved, then Node.js | ||
| 411 | 411 | will attempt to load an `index.js` or `index.node` file out of that | |
| 412 | - directory. For example, if there was no `package.json` file in the above | ||
| 412 | + directory. For example, if there was no [`package.json`][] file in the previous | ||
| 413 | 413 | example, then `require('./some-library')` would attempt to load: | |
| 414 | 414 | ||
| 415 | 415 | * `./some-library/index.js` | |
@@ -1154,3 +1154,5 @@ consists of the following keys: | |||
| 1154 | 1154 | [`Error.prepareStackTrace(error, trace)`]: https://v8.dev/docs/stack-trace-api#customizing-stack-traces | |
| 1155 | 1155 | [`SourceMap`]: modules.html#modules_class_module_sourcemap | |
| 1156 | 1156 | [Source map v3 format]: https://sourcemaps.info/spec.html#h.mofvlxcwqzej | |
| 1157 | + [`package.json`]: packages.html#packages_node_js_package_json_field_definitions | ||
| 1158 | + [`"main"`]: packages.html#packages_main | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments