2
2
3
3
<!-- type=misc-->
4
4
5
- Node.js comes with a wide variety of CLI options. These options expose built-in
5
+ Node.js comes with a variety of CLI options. These options expose built-in
6
6
debugging, multiple ways to execute scripts, and other helpful runtime options.
7
7
8
8
To view this documentation as a manual page in your terminal, run ` man node ` .
@@ -24,38 +24,59 @@ _For more info about `node debug`, please see the [debugger][] documentation._
24
24
## Options
25
25
26
26
### ` -v ` , ` --version `
27
+ <!-- YAML
28
+ added: v0.1.3
29
+ -->
27
30
28
31
Print node's version.
29
32
30
33
31
34
### ` -h ` , ` --help `
35
+ <!-- YAML
36
+ added: v0.1.3
37
+ -->
32
38
33
39
Print node command line options.
34
40
The output of this option is less detailed than this document.
35
41
36
42
37
43
### ` -e ` , ` --eval "script" `
44
+ <!-- YAML
45
+ added: v0.5.2
46
+ -->
38
47
39
48
Evaluate the following argument as JavaScript. The modules which are
40
49
predefined in the REPL can also be used in ` script ` .
41
50
42
51
43
52
### ` -p ` , ` --print "script" `
53
+ <!-- YAML
54
+ added: v0.6.4
55
+ -->
44
56
45
57
Identical to ` -e ` but prints the result.
46
58
47
59
48
60
### ` -c ` , ` --check `
61
+ <!-- YAML
62
+ added: v5.0.0
63
+ -->
49
64
50
65
Syntax check the script without executing.
51
66
52
67
53
68
### ` -i ` , ` --interactive `
69
+ <!-- YAML
70
+ added: v0.7.7
71
+ -->
54
72
55
73
Opens the REPL even if stdin does not appear to be a terminal.
56
74
57
75
58
76
### ` -r ` , ` --require module `
77
+ <!-- YAML
78
+ added: v1.6.0
79
+ -->
59
80
60
81
Preload the specified module at startup.
61
82
@@ -64,40 +85,64 @@ rules. `module` may be either a path to a file, or a node module name.
64
85
65
86
66
87
### ` --no-deprecation `
88
+ <!-- YAML
89
+ added: v0.8.0
90
+ -->
67
91
68
92
Silence deprecation warnings.
69
93
70
94
71
95
### ` --trace-deprecation `
96
+ <!-- YAML
97
+ added: v0.8.0
98
+ -->
72
99
73
100
Print stack traces for deprecations.
74
101
75
102
76
103
### ` --throw-deprecation `
104
+ <!-- YAML
105
+ added: v0.11.14
106
+ -->
77
107
78
108
Throw errors for deprecations.
79
109
80
110
### ` --no-warnings `
111
+ <!-- YAML
112
+ added: v6.0.0
113
+ -->
81
114
82
115
Silence all process warnings (including deprecations).
83
116
84
117
### ` --trace-warnings `
118
+ <!-- YAML
119
+ added: v6.0.0
120
+ -->
85
121
86
122
Print stack traces for process warnings (including deprecations).
87
123
88
124
### ` --trace-sync-io `
125
+ <!-- YAML
126
+ added: v2.1.0
127
+ -->
89
128
90
129
Prints a stack trace whenever synchronous I/O is detected after the first turn
91
130
of the event loop.
92
131
93
132
94
133
### ` --zero-fill-buffers `
134
+ <!-- YAML
135
+ added: v6.0.0
136
+ -->
95
137
96
138
Automatically zero-fills all newly allocated [ Buffer] [ ] and [ SlowBuffer] [ ]
97
139
instances.
98
140
99
141
100
142
### ` --preserve-symlinks `
143
+ <!-- YAML
144
+ added: v6.3.0
145
+ -->
101
146
102
147
Instructs the module loader to preserve symbolic links when resolving and
103
148
caching modules.
@@ -135,16 +180,25 @@ see those as two separate modules and would attempt to load the module multiple
135
180
times, causing an exception to be thrown).
136
181
137
182
### ` --track-heap-objects `
183
+ <!-- YAML
184
+ added: v2.4.0
185
+ -->
138
186
139
187
Track heap object allocations for heap snapshots.
140
188
141
189
142
190
### ` --prof-process `
191
+ <!-- YAML
192
+ added: v6.0.0
193
+ -->
143
194
144
195
Process v8 profiler output generated using the v8 option ` --prof ` .
145
196
146
197
147
198
### ` --v8-options `
199
+ <!-- YAML
200
+ added: v0.1.3
201
+ -->
148
202
149
203
Print v8 command line options.
150
204
@@ -154,53 +208,80 @@ Note: v8 options allow words to be separated by both dashes (`-`) or underscores
154
208
For example, ` --stack-trace-limit ` is equivalent to ` --stack_trace_limit ` .
155
209
156
210
### ` --tls-cipher-list=list `
211
+ <!-- YAML
212
+ added: v4.0.0
213
+ -->
157
214
158
215
Specify an alternative default TLS cipher list. (Requires Node.js to be built
159
216
with crypto support. (Default))
160
217
161
218
162
219
### ` --enable-fips `
220
+ <!-- YAML
221
+ added: v6.0.0
222
+ -->
163
223
164
224
Enable FIPS-compliant crypto at startup. (Requires Node.js to be built with
165
225
` ./configure --openssl-fips ` )
166
226
167
227
168
228
### ` --force-fips `
229
+ <!-- YAML
230
+ added: v6.0.0
231
+ -->
169
232
170
233
Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.)
171
234
(Same requirements as ` --enable-fips ` )
172
235
173
236
174
237
### ` --icu-data-dir=file `
238
+ <!-- YAML
239
+ added: v0.11.15
240
+ -->
175
241
176
242
Specify ICU data load path. (overrides ` NODE_ICU_DATA ` )
177
243
178
244
## Environment Variables
179
245
180
246
### ` NODE_DEBUG=module[,…] `
247
+ <!-- YAML
248
+ added: v0.1.32
249
+ -->
181
250
182
251
` ',' ` -separated list of core modules that should print debug information.
183
252
184
253
185
254
### ` NODE_PATH=path[:…] `
255
+ <!-- YAML
256
+ added: v0.1.32
257
+ -->
186
258
187
259
` ':' ` -separated list of directories prefixed to the module search path.
188
260
189
261
_ Note: on Windows, this is a ` ';' ` -separated list instead._
190
262
191
263
192
264
### ` NODE_DISABLE_COLORS=1 `
265
+ <!-- YAML
266
+ added: v0.3.0
267
+ -->
193
268
194
269
When set to ` 1 ` colors will not be used in the REPL.
195
270
196
271
197
272
### ` NODE_ICU_DATA=file `
273
+ <!-- YAML
274
+ added: v0.11.15
275
+ -->
198
276
199
277
Data path for ICU (Intl object) data. Will extend linked-in data when compiled
200
278
with small-icu support.
201
279
202
280
203
281
### ` NODE_REPL_HISTORY=file `
282
+ <!-- YAML
283
+ added: v5.0.0
284
+ -->
204
285
205
286
Path to the file used to store the persistent REPL history. The default path is
206
287
` ~/.node_repl_history ` , which is overridden by this variable. Setting the value
0 commit comments