Lines Matching +full:post +full:- +full:require +full:- +full:hook
3 <!--introduced_in=v5.9.1-->
4 <!--type=misc-->
6 Node.js comes with a variety of CLI options. These options expose built-in
13 `node [options] [V8 options] [script.js | -e "script" | -] [--] [arguments]`
15 `node inspect [script.js | -e "script" | <host>:<port>] …`
17 `node --v8-options`
24 <!-- YAML
26 - version: v10.12.0
27 pr-url: https://github.com/nodejs/node/pull/23020
30 -->
33 dashes (`-`) or underscores (`_`).
35 For example, `--pending-deprecation` is equivalent to `--pending_deprecation`.
37 If an option that takes a single value, for example `--max-http-header-size`,
42 ### `-`
43 <!-- YAML
45 -->
47 Alias for stdin. Analogous to the use of `-` in other command line utilities,
51 ### `--`
52 <!-- YAML
54 -->
60 ### `--abort-on-uncaught-exception`
61 <!-- YAML
63 -->
65 Aborting instead of exiting causes a core file to be generated for post-mortem
72 ### `--completion-bash`
73 <!-- YAML
75 -->
77 Print source-able bash completion script for Node.js.
80 $ node --completion-bash > node_bash_completion
84 ### `--conditions=condition`
85 <!-- YAML
87 -->
89 > Stability: 1 - Experimental
97 `"require"` will always apply as defined.
99 ### `--cpu-prof`
100 <!-- YAML
102 -->
104 > Stability: 1 - Experimental
109 If `--cpu-prof-dir` is not specified, the generated profile will be placed
112 If `--cpu-prof-name` is not specified, the generated profile will be
116 $ node --cpu-prof index.js
121 ### `--cpu-prof-dir`
122 <!-- YAML
124 -->
126 > Stability: 1 - Experimental
128 Specify the directory where the CPU profiles generated by `--cpu-prof` will
132 [--diagnostic-dir](#cli_diagnostic_dir_directory) command line option.
134 ### `--cpu-prof-interval`
135 <!-- YAML
137 -->
139 > Stability: 1 - Experimental
142 by `--cpu-prof`. The default is 1000 microseconds.
144 ### `--cpu-prof-name`
145 <!-- YAML
147 -->
149 > Stability: 1 - Experimental
151 Specify the file name of the CPU profile generated by `--cpu-prof`.
153 ### `--diagnostic-dir=directory`
159 * [--cpu-prof-dir](#cli_cpu_prof_dir)
160 * [--heap-prof-dir](#cli_heap_prof_dir)
161 * [--redirect-warnings](#cli_redirect_warnings_file)
163 ### `--disable-proto=mode`
164 <!--YAML
166 -->
172 ### `--disallow-code-generation-from-strings`
173 <!-- YAML
175 -->
177 Make built-in language features like `eval` and `new Function` that generate
181 ### `--enable-fips`
182 <!-- YAML
184 -->
186 Enable FIPS-compliant crypto at startup. (Requires Node.js to be built with
187 `./configure --openssl-fips`.)
189 ### `--enable-source-maps`
190 <!-- YAML
192 -->
194 > Stability: 1 - Experimental
199 `--enable-source-maps` flag is set.
201 ### `--experimental-import-meta-resolve`
202 <!-- YAML
204 -->
208 ### `--experimental-json-modules`
209 <!-- YAML
211 -->
215 ### `--experimental-loader=module`
216 <!-- YAML
218 -->
223 ### `--experimental-modules`
224 <!-- YAML
226 -->
230 ### `--experimental-policy`
231 <!-- YAML
233 -->
237 ### `--experimental-repl-await`
238 <!-- YAML
240 -->
242 Enable experimental top-level `await` keyword support in REPL.
244 ### `--experimental-specifier-resolution=mode`
245 <!-- YAML
247 -->
258 ### `--experimental-vm-modules`
259 <!-- YAML
261 -->
265 ### `--experimental-wasi-unstable-preview1`
266 <!-- YAML
268 -->
272 ### `--experimental-wasm-modules`
273 <!-- YAML
275 -->
277 ### `--force-context-aware`
278 <!-- YAML
280 -->
282 Disable loading native addons that are not [context-aware][].
286 ### `--force-fips`
287 <!-- YAML
289 -->
291 Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.)
292 (Same requirements as `--enable-fips`.)
294 ### `--frozen-intrinsics`
295 <!-- YAML
297 -->
299 > Stability: 1 - Experimental
307 `--require` runs prior to freezing intrinsics in order to allow polyfills to
310 ### `--heapsnapshot-signal=signal`
311 <!-- YAML
313 -->
320 $ node --heapsnapshot-signal=SIGUSR2 index.js &
323 node 1 5.5 6.1 787252 247004 ? Ssl 16:43 0:02 node --heapsnapshot-signal=SIGUSR2…
324 $ kill -USR2 1
329 ### `--heap-prof`
330 <!-- YAML
332 -->
334 > Stability: 1 - Experimental
339 If `--heap-prof-dir` is not specified, the generated profile will be placed
342 If `--heap-prof-name` is not specified, the generated profile will be
346 $ node --heap-prof index.js
351 ### `--heap-prof-dir`
352 <!-- YAML
354 -->
356 > Stability: 1 - Experimental
358 Specify the directory where the heap profiles generated by `--heap-prof` will
362 [--diagnostic-dir](#cli_diagnostic_dir_directory) command line option.
364 ### `--heap-prof-interval`
365 <!-- YAML
367 -->
369 > Stability: 1 - Experimental
372 by `--heap-prof`. The default is 512 * 1024 bytes.
374 ### `--heap-prof-name`
375 <!-- YAML
377 -->
379 > Stability: 1 - Experimental
381 Specify the file name of the heap profile generated by `--heap-prof`.
383 ### `--http-parser=library`
384 <!-- YAML
386 -->
391 * `legacy` for <https://github.com/nodejs/http-parser>
397 This flag is likely to become a no-op and removed at some point in the future.
399 ### `--http-server-default-timeout=milliseconds`
400 <!-- YAML
402 -->
410 ### `--icu-data-dir=file`
411 <!-- YAML
413 -->
417 ### `--input-type=type`
418 <!-- YAML
420 -->
423 module. String input is input via `--eval`, `--print`, or `STDIN`.
427 ### `--inspect-brk[=[host:]port]`
428 <!-- YAML
430 -->
435 ### `--inspect-port=[host:]port`
436 <!-- YAML
438 -->
448 ### `--inspect[=[host:]port]`
449 <!-- YAML
451 -->
471 **More specifically, `--inspect=0.0.0.0` is insecure if the port (`9229` by
472 default) is not firewall-protected.**
476 ### `--inspect-publish-uid=stderr,http`
483 ### `--insecure-http-parser`
484 <!-- YAML
486 -->
489 interoperability with non-conformant HTTP implementations. It may also allow
493 ### `--jitless`
494 <!-- YAML
496 -->
503 disappear in a non-semver-major release.
505 ### `--max-http-header-size=size`
506 <!-- YAML
508 -->
512 ### `--napi-modules`
513 <!-- YAML
515 -->
517 This option is a no-op. It is kept for compatibility.
519 ### `--no-deprecation`
520 <!-- YAML
522 -->
526 ### `--no-force-async-hooks-checks`
527 <!-- YAML
529 -->
534 ### `--no-warnings`
535 <!-- YAML
537 -->
541 ### `--openssl-config=file`
542 <!-- YAML
544 -->
547 used to enable FIPS-compliant crypto if Node.js is built with
548 `./configure --openssl-fips`.
550 ### `--pending-deprecation`
551 <!-- YAML
553 -->
559 unless either the `--pending-deprecation` command line flag, or the
564 ### `--policy-integrity=sri`
565 <!-- YAML
567 -->
569 > Stability: 1 - Experimental
575 ### `--preserve-symlinks`
576 <!-- YAML
578 -->
584 to a different on-disk location, Node.js will dereference the link and use the
585 actual on-disk "real path" of the module as both an identifier and as a root
589 be thrown if `moduleA` attempts to require `moduleB` as a peer dependency:
596 │ ├── moduleA -> {appDir}/moduleA
605 The `--preserve-symlinks` command line flag instructs Node.js to use the
609 Note, however, that using `--preserve-symlinks` can have other side effects.
615 The `--preserve-symlinks` flag does not apply to the main module, which allows
616 `node --preserve-symlinks node_module/.bin/<foo>` to work. To apply the same
617 behavior for the main module, also use `--preserve-symlinks-main`.
619 ### `--preserve-symlinks-main`
620 <!-- YAML
622 -->
625 caching the main module (`require.main`).
627 This flag exists so that the main module can be opted-in to the same behavior
628 that `--preserve-symlinks` gives to all other imports; they are separate flags,
631 `--preserve-symlinks-main` does not imply `--preserve-symlinks`; it
632 is expected that `--preserve-symlinks-main` will be used in addition to
633 `--preserve-symlinks` when it is not desirable to follow symlinks before
636 See `--preserve-symlinks` for more information.
638 ### `--prof`
639 <!-- YAML
641 -->
645 ### `--prof-process`
646 <!-- YAML
648 -->
650 Process V8 profiler output generated using the V8 option `--prof`.
652 ### `--redirect-warnings=file`
653 <!-- YAML
655 -->
664 [--diagnostic-dir](#cli_diagnostic_dir_directory) command line option.
666 ### `--report-compact`
667 <!-- YAML
669 -->
671 Write reports in a compact format, single-line JSON, more easily consumable
672 by log processing systems than the default multi-line format designed for
675 ### `--report-dir=directory`, `report-directory=directory`
676 <!-- YAML
679 - version: v12.17.0
680 pr-url: https://github.com/nodejs/node/pull/32242
682 - version: v12.0.0
683 pr-url: https://github.com/nodejs/node/pull/27312
684 description: Changed from `--diagnostic-report-directory` to
685 `--report-directory`
686 -->
690 ### `--report-filename=filename`
691 <!-- YAML
694 - version: v12.17.0
695 pr-url: https://github.com/nodejs/node/pull/32242
697 - version: v12.0.0
698 pr-url: https://github.com/nodejs/node/pull/27312
699 description: changed from `--diagnostic-report-filename` to
700 `--report-filename`
701 -->
705 ### `--report-on-fatalerror`
706 <!-- YAML
709 - version: v12.17.0
710 pr-url: https://github.com/nodejs/node/pull/32496
712 - version: v12.0.0
713 pr-url: https://github.com/nodejs/node/pull/27312
714 description: changed from `--diagnostic-report-on-fatalerror` to
715 `--report-on-fatalerror`
716 -->
724 ### `--report-on-signal`
725 <!-- YAML
728 - version: v12.17.0
729 pr-url: https://github.com/nodejs/node/pull/32242
731 - version: v12.0.0
732 pr-url: https://github.com/nodejs/node/pull/27312
733 description: changed from `--diagnostic-report-on-signal` to
734 `--report-on-signal`
735 -->
739 specified through `--report-signal`.
741 ### `--report-signal=signal`
742 <!-- YAML
745 - version: v12.17.0
746 pr-url: https://github.com/nodejs/node/pull/32242
748 - version: v12.0.0
749 pr-url: https://github.com/nodejs/node/pull/27312
750 description: changed from `--diagnostic-report-signal` to
751 `--report-signal`
752 -->
757 ### `--report-uncaught-exception`
758 <!-- YAML
761 - version: v12.17.0
762 pr-url: https://github.com/nodejs/node/pull/32242
764 - version: v12.0.0
765 pr-url: https://github.com/nodejs/node/pull/27312
766 description: changed from `--diagnostic-report-uncaught-exception` to
767 `--report-uncaught-exception`
768 -->
774 ### `--throw-deprecation`
775 <!-- YAML
777 -->
781 ### `--title=title`
782 <!-- YAML
784 -->
788 ### `--tls-cipher-list=list`
789 <!-- YAML
791 -->
796 ### `--tls-keylog=file`
797 <!-- YAML
799 -->
805 ### `--tls-max-v1.2`
806 <!-- YAML
808 -->
813 ### `--tls-max-v1.3`
814 <!-- YAML
816 -->
821 ### `--tls-min-v1.0`
822 <!-- YAML
824 -->
829 ### `--tls-min-v1.1`
830 <!-- YAML
832 -->
837 ### `--tls-min-v1.2`
838 <!-- YAML
840 -->
846 ### `--tls-min-v1.3`
847 <!-- YAML
849 -->
854 ### `--trace-deprecation`
855 <!-- YAML
857 -->
861 ### `--trace-event-categories`
862 <!-- YAML
864 -->
867 tracing is enabled using `--trace-events-enabled`.
869 ### `--trace-event-file-pattern`
870 <!-- YAML
872 -->
877 ### `--trace-events-enabled`
878 <!-- YAML
880 -->
884 ### `--trace-exit`
885 <!-- YAML
887 -->
892 ### `--trace-sigint`
893 <!-- YAML
895 -->
899 ### `--trace-sync-io`
900 <!-- YAML
902 -->
907 ### `--trace-tls`
908 <!-- YAML
910 -->
915 ### `--trace-uncaught`
916 <!-- YAML
918 -->
927 ### `--trace-warnings`
928 <!-- YAML
930 -->
934 ### `--track-heap-objects`
935 <!-- YAML
937 -->
941 ### `--unhandled-rejections=mode`
942 <!-- YAML
944 -->
947 for the very first unhandled rejection in case no [`unhandledRejection`][] hook
955 hook is set or not but do not print the deprecation warning.
958 ### `--use-bundled-ca`, `--use-openssl-ca`
959 <!-- YAML
961 -->
965 at build-time.
978 ### `--use-largepages=mode`
979 <!-- YAML
981 -->
983 Re-map the Node.js static code to large memory pages at startup. If supported on
994 ### `--v8-options`
995 <!-- YAML
997 -->
1001 ### `--v8-pool-size=num`
1002 <!-- YAML
1004 -->
1014 ### `--zero-fill-buffers`
1015 <!-- YAML
1017 -->
1019 Automatically zero-fills all newly allocated [`Buffer`][] and [`SlowBuffer`][]
1022 ### `-c`, `--check`
1023 <!-- YAML
1025 - v5.0.0
1026 - v4.2.0
1028 - version: v10.0.0
1029 pr-url: https://github.com/nodejs/node/pull/19600
1030 description: The `--require` option is now supported when checking a file.
1031 -->
1035 ### `-e`, `--eval "script"`
1036 <!-- YAML
1039 - version: v5.11.0
1040 pr-url: https://github.com/nodejs/node/pull/5348
1041 description: Built-in libraries are now available as predefined variables.
1042 -->
1051 ### `-h`, `--help`
1052 <!-- YAML
1054 -->
1059 ### `-i`, `--interactive`
1060 <!-- YAML
1062 -->
1066 ### `-p`, `--print "script"`
1067 <!-- YAML
1070 - version: v5.11.0
1071 pr-url: https://github.com/nodejs/node/pull/5348
1072 description: Built-in libraries are now available as predefined variables.
1073 -->
1075 Identical to `-e` but prints the result.
1077 ### `-r`, `--require module`
1078 <!-- YAML
1080 -->
1084 Follows `require()`'s module resolution
1087 ### `-v`, `--version`
1088 <!-- YAML
1090 -->
1097 <!-- YAML
1099 -->
1101 `','`-separated list of core modules that should print debug information.
1105 `','`-separated list of core C++ modules that should print debug information.
1108 <!-- YAML
1110 -->
1115 <!-- YAML
1117 -->
1132 <!-- YAML
1134 -->
1136 Data path for ICU (`Intl` object) data. Will extend linked-in data when compiled
1137 with small-icu support.
1140 <!-- YAML
1142 -->
1147 <!-- YAML
1149 -->
1151 A space-separated list of command line options. `options...` are interpreted
1154 an option that is not allowed in the environment is used, such as `-p` or a
1158 in `--require`), it must be escaped using double quotes. For example:
1161 NODE_OPTIONS='--require "./my path/file.js"'
1169 NODE_OPTIONS='--inspect=localhost:4444' node --inspect=localhost:5555
1177 NODE_OPTIONS='--require "./a.js"' node --require "./b.js"
1179 node --require "./a.js" --require "./b.js"
1183 <!-- node-options-node start -->
1184 * `--conditions`
1185 * `--diagnostic-dir`
1186 * `--disable-proto`
1187 * `--enable-fips`
1188 * `--enable-source-maps`
1189 * `--experimental-import-meta-resolve`
1190 * `--experimental-json-modules`
1191 * `--experimental-loader`
1192 * `--experimental-modules`
1193 * `--experimental-policy`
1194 * `--experimental-repl-await`
1195 * `--experimental-specifier-resolution`
1196 * `--experimental-vm-modules`
1197 * `--experimental-wasi-unstable-preview1`
1198 * `--experimental-wasm-modules`
1199 * `--force-context-aware`
1200 * `--force-fips`
1201 * `--frozen-intrinsics`
1202 * `--heapsnapshot-signal`
1203 * `--http-parser`
1204 * `--http-server-default-timeout`
1205 * `--icu-data-dir`
1206 * `--input-type`
1207 * `--insecure-http-parser`
1208 * `--inspect-brk`
1209 * `--inspect-port`, `--debug-port`
1210 * `--inspect-publish-uid`
1211 * `--inspect`
1212 * `--max-http-header-size`
1213 * `--napi-modules`
1214 * `--no-deprecation`
1215 * `--no-force-async-hooks-checks`
1216 * `--no-warnings`
1217 * `--openssl-config`
1218 * `--pending-deprecation`
1219 * `--policy-integrity`
1220 * `--preserve-symlinks-main`
1221 * `--preserve-symlinks`
1222 * `--prof-process`
1223 * `--redirect-warnings`
1224 * `--report-compact`
1225 * `--report-dir`, `--report-directory`
1226 * `--report-filename`
1227 * `--report-on-fatalerror`
1228 * `--report-on-signal`
1229 * `--report-signal`
1230 * `--report-uncaught-exception`
1231 * `--require`, `-r`
1232 * `--throw-deprecation`
1233 * `--title`
1234 * `--tls-cipher-list`
1235 * `--tls-keylog`
1236 * `--tls-max-v1.2`
1237 * `--tls-max-v1.3`
1238 * `--tls-min-v1.0`
1239 * `--tls-min-v1.1`
1240 * `--tls-min-v1.2`
1241 * `--tls-min-v1.3`
1242 * `--trace-deprecation`
1243 * `--trace-event-categories`
1244 * `--trace-event-file-pattern`
1245 * `--trace-events-enabled`
1246 * `--trace-exit`
1247 * `--trace-sigint`
1248 * `--trace-sync-io`
1249 * `--trace-tls`
1250 * `--trace-uncaught`
1251 * `--trace-warnings`
1252 * `--track-heap-objects`
1253 * `--unhandled-rejections`
1254 * `--use-bundled-ca`
1255 * `--use-largepages`
1256 * `--use-openssl-ca`
1257 * `--v8-pool-size`
1258 * `--zero-fill-buffers`
1259 <!-- node-options-node end -->
1262 <!-- node-options-v8 start -->
1263 * `--abort-on-uncaught-exception`
1264 * `--disallow-code-generation-from-strings`
1265 * `--huge-max-old-generation-size`
1266 * `--interpreted-frames-native-stack`
1267 * `--jitless`
1268 * `--max-old-space-size`
1269 * `--perf-basic-prof-only-functions`
1270 * `--perf-basic-prof`
1271 * `--perf-prof-unwinding-info`
1272 * `--perf-prof`
1273 * `--stack-trace-limit`
1274 <!-- node-options-v8 end -->
1276 `--perf-basic-prof-only-functions`, `--perf-basic-prof`,
1277 `--perf-prof-unwinding-info`, and `--perf-prof` are only available on Linux.
1280 <!-- YAML
1282 -->
1284 `':'`-separated list of directories prefixed to the module search path.
1286 On Windows, this is a `';'`-separated list instead.
1289 <!-- YAML
1291 -->
1297 unless either the `--pending-deprecation` command line flag, or the
1308 <!-- YAML
1310 -->
1316 <!-- YAML
1318 -->
1324 equivalent to using the `--redirect-warnings=file` command-line flag.
1327 <!-- YAML
1329 -->
1336 <!-- YAML
1338 -->
1340 Path to a Node.js module which will be loaded in place of the built-in REPL.
1341 Overriding this value to an empty string (`''`) will use the built-in REPL.
1362 Coverage is output as an array of [ScriptCoverage][] objects on the top-level
1379 > Stability: 1 - Experimental
1381 If found, source map data is appended to the top-level key `source-map-cache`
1384 `source-map-cache` is an object with keys representing the files source maps
1385 were extracted from, and values which include the raw source-map URL
1398 "source-map-cache": {
1400 "url": "./path-to-map.json",
1426 <!-- YAML
1428 -->
1431 used to enable FIPS-compliant crypto if Node.js is built with `./configure
1432 --openssl-fips`.
1434 If the [`--openssl-config`][] command line option is used, the environment
1438 <!-- YAML
1440 -->
1442 If `--use-openssl-ca` is enabled, this overrides and sets OpenSSL's directory
1450 <!-- YAML
1452 -->
1454 If `--use-openssl-ca` is enabled, this overrides and sets OpenSSL's file
1495 ### `--max-old-space-size=SIZE` (in megabytes)
1505 $ node --max-old-space-size=1536 index.js
1508 [`--openssl-config`]: #cli_openssl_config_file
1516 [Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/
1518 [ScriptCoverage]: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCovera…
1520 [Subresource Integrity]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
1521 [V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
1522 [context-aware]: addons.html#addons_context_aware_addons
1525 …rity implications]: https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implicat…