| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,7 +80,7 @@ $ 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: | |
| 86 | 86 | - v14.9.0 | |
@@ -89,14 +89,20 @@ added: | |||
| 89 | 89 | ||
| 90 | 90 | > Stability: 1 - Experimental | |
| 91 | 91 | ||
| 92 | - Enable experimental support for custom conditional exports resolution | ||
| 92 | + Enable experimental support for custom [conditional exports][] resolution | ||
| 93 | 93 | conditions. | |
| 94 | 94 | ||
| 95 | 95 | Any number of custom string condition names are permitted. | |
| 96 | 96 | ||
| 97 | 97 | The default Node.js conditions of `"node"`, `"default"`, `"import"`, and | |
| 98 | 98 | `"require"` will always apply as defined. | |
| 99 | 99 | ||
| 100 | + For example, to run a module with "development" resolutions: | ||
| 101 | + | ||
| 102 | + ```console | ||
| 103 | + $ node -C=development app.js | ||
| 104 | + ``` | ||
| 105 | + | ||
| 100 | 106 | ### `--cpu-prof` | |
| 101 | 107 | <!-- YAML | |
| 102 | 108 | added: v12.0.0 | |
@@ -1368,7 +1374,7 @@ node --require "./a.js" --require "./b.js" | |||
| 1368 | 1374 | ||
| 1369 | 1375 | Node.js options that are allowed are: | |
| 1370 | 1376 | <!-- node-options-node start --> | |
| 1371 | - * `--conditions` | ||
| 1377 | + * `--conditions`, `-C` | ||
| 1372 | 1378 | * `--diagnostic-dir` | |
| 1373 | 1379 | * `--disable-proto` | |
| 1374 | 1380 | * `--enable-fips` | |
@@ -1764,6 +1770,7 @@ $ node --max-old-space-size=1536 index.js | |||
| 1764 | 1770 | [`tls.DEFAULT_MIN_VERSION`]: tls.md#tls_tls_default_min_version | |
| 1765 | 1771 | [`unhandledRejection`]: process.md#process_event_unhandledrejection | |
| 1766 | 1772 | [`worker_threads.threadId`]: worker_threads.md#worker_threads_worker_threadid | |
| 1773 | + [conditional exports]: packages.md#packages_conditional_exports | ||
| 1767 | 1774 | [context-aware]: addons.md#addons_context_aware_addons | |
| 1768 | 1775 | [customizing ESM specifier resolution]: esm.md#esm_customizing_esm_specifier_resolution_algorithm | |
| 1769 | 1776 | [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 | |
|---|---|---|---|
@@ -292,6 +292,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { | |||
| 292 | 292 | "additional user conditions for conditional exports and imports", | |
| 293 | 293 | &EnvironmentOptions::conditions, | |
| 294 | 294 | kAllowedInEnvironment); | |
| 295 | + AddAlias("-C", "--conditions"); | ||
| 295 | 296 | AddOption("--diagnostic-dir", | |
| 296 | 297 | "set dir for all output files" | |
| 297 | 298 | " (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