| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,21 +80,27 @@ $ node --completion-bash > node_bash_completion | |||
| 80 | 80 | $ source node_bash_completion | |
| 81 | 81 | ``` | |
| 82 | 82 | ||
| 83 | - ### `--conditions=condition` | ||
| 83 | + ### `-C=condition`, `--conditions=condition` | ||
| 84 | 84 | <!-- YAML | |
| 85 | 85 | added: v14.9.0 | |
| 86 | 86 | --> | |
| 87 | 87 | ||
| 88 | 88 | > Stability: 1 - Experimental | |
| 89 | 89 | ||
| 90 | - Enable experimental support for custom conditional exports resolution | ||
| 90 | + Enable experimental support for custom [conditional exports][] resolution | ||
| 91 | 91 | conditions. | |
| 92 | 92 | ||
| 93 | 93 | Any number of custom string condition names are permitted. | |
| 94 | 94 | ||
| 95 | 95 | The default Node.js conditions of `"node"`, `"default"`, `"import"`, and | |
| 96 | 96 | `"require"` will always apply as defined. | |
| 97 | 97 | ||
| 98 | + For example, to run a module with "development" resolutions: | ||
| 99 | + | ||
| 100 | + ```console | ||
| 101 | + $ node -C=development app.js | ||
| 102 | + ``` | ||
| 103 | + | ||
| 98 | 104 | ### `--cpu-prof` | |
| 99 | 105 | <!-- YAML | |
| 100 | 106 | added: v12.0.0 | |
@@ -1259,7 +1265,7 @@ node --require "./a.js" --require "./b.js" | |||
| 1259 | 1265 | ||
| 1260 | 1266 | Node.js options that are allowed are: | |
| 1261 | 1267 | <!-- node-options-node start --> | |
| 1262 | - * `--conditions` | ||
| 1268 | + * `--conditions`, `-C` | ||
| 1263 | 1269 | * `--diagnostic-dir` | |
| 1264 | 1270 | * `--disable-proto` | |
| 1265 | 1271 | * `--enable-fips` | |
@@ -1620,6 +1626,7 @@ $ node --max-old-space-size=1536 index.js | |||
| 1620 | 1626 | [`tls.DEFAULT_MIN_VERSION`]: tls.md#tls_tls_default_min_version | |
| 1621 | 1627 | [`unhandledRejection`]: process.md#process_event_unhandledrejection | |
| 1622 | 1628 | [`worker_threads.threadId`]: worker_threads.md#worker_threads_worker_threadid | |
| 1629 | + [conditional exports]: packages.md#packages_conditional_exports | ||
| 1623 | 1630 | [context-aware]: addons.md#addons_context_aware_addons | |
| 1624 | 1631 | [customizing ESM specifier resolution]: esm.md#esm_customizing_esm_specifier_resolution_algorithm | |
| 1625 | 1632 | [debugger]: debugger.md | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,7 +78,7 @@ Aborting instead of exiting causes a core file to be generated for analysis. | |||
| 78 | 78 | .It Fl -completion-bash | |
| 79 | 79 | Print source-able bash completion script for Node.js. | |
| 80 | 80 | . | |
| 81 | - .It Fl -conditions Ar string | ||
| 81 | + .It Fl C , Fl -conditions Ar string | ||
| 82 | 82 | Use custom conditional exports conditions. | |
| 83 | 83 | .Ar string | |
| 84 | 84 | . | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -272,6 +272,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { | |||
| 272 | 272 | "additional user conditions for conditional exports and imports", | |
| 273 | 273 | &EnvironmentOptions::conditions, | |
| 274 | 274 | kAllowedInEnvironment); | |
| 275 | + AddAlias("-C", "--conditions"); | ||
| 275 | 276 | AddOption("--diagnostic-dir", | |
| 276 | 277 | "set dir for all output files" | |
| 277 | 278 | " (default: current working directory)", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - // Flags: --conditions=custom-condition --conditions another | ||
| 1 | + // Flags: --conditions=custom-condition -C another | ||
| 2 | 2 | import { mustCall } from '../common/index.mjs'; | |
| 3 | 3 | import { strictEqual } from 'assert'; | |
| 4 | 4 | import { requireFixture, importFixture } from '../fixtures/pkgexports.mjs'; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,7 +51,7 @@ const assert = require('assert'); | |||
| 51 | 51 | // Assert all "canonical" flags begin with dash(es) | |
| 52 | 52 | { | |
| 53 | 53 | process.allowedNodeEnvironmentFlags.forEach((flag) => { | |
| 54 | - assert(/^--?[a-z0-9._-]+$/.test(flag), | ||
| 54 | + assert(/^--?[a-zA-Z0-9._-]+$/.test(flag), | ||
| 55 | 55 | `Unexpected format for flag ${flag}`); | |
| 56 | 56 | }); | |
| 57 | 57 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments