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,37 +24,58 @@ _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.
40
49
41
50
42
51
### ` -p ` , ` --print "script" `
52
+ <!-- YAML
53
+ added: v0.6.4
54
+ -->
43
55
44
56
Identical to ` -e ` but prints the result.
45
57
46
58
47
59
### ` -c ` , ` --check `
60
+ <!-- YAML
61
+ added: v4.2.0
62
+ -->
48
63
49
64
Syntax check the script without executing.
50
65
51
66
52
67
### ` -i ` , ` --interactive `
68
+ <!-- YAML
69
+ added: v0.7.7
70
+ -->
53
71
54
72
Opens the REPL even if stdin does not appear to be a terminal.
55
73
56
74
57
75
### ` -r ` , ` --require module `
76
+ <!-- YAML
77
+ added: v1.6.0
78
+ -->
58
79
59
80
Preload the specified module at startup.
60
81
@@ -63,48 +84,75 @@ rules. `module` may be either a path to a file, or a node module name.
63
84
64
85
65
86
### ` --no-deprecation `
87
+ <!-- YAML
88
+ added: v0.8.0
89
+ -->
66
90
67
91
Silence deprecation warnings.
68
92
69
93
70
94
### ` --trace-deprecation `
95
+ <!-- YAML
96
+ added: v0.8.0
97
+ -->
71
98
72
99
Print stack traces for deprecations.
73
100
74
101
75
102
### ` --throw-deprecation `
103
+ <!-- YAML
104
+ added: v0.11.14
105
+ -->
76
106
77
107
Throw errors for deprecations.
78
108
79
109
80
110
### ` --trace-sync-io `
111
+ <!-- YAML
112
+ added: v2.1.0
113
+ -->
81
114
82
115
Prints a stack trace whenever synchronous I/O is detected after the first turn
83
116
of the event loop.
84
117
85
118
86
119
### ` --zero-fill-buffers `
120
+ <!-- YAML
121
+ added: v4.5.0
122
+ -->
87
123
88
124
Automatically zero-fills all newly allocated [ Buffer] [ ] and [ SlowBuffer] [ ]
89
125
instances.
90
126
91
127
92
128
### ` --track-heap-objects `
129
+ <!-- YAML
130
+ added: v2.4.0
131
+ -->
93
132
94
133
Track heap object allocations for heap snapshots.
95
134
96
135
97
136
### ` --prof-process `
137
+ <!-- YAML
138
+ added: v4.4.0
139
+ -->
98
140
99
141
Process v8 profiler output generated using the v8 option ` --prof ` .
100
142
101
143
102
144
### ` --v8-options `
145
+ <!-- YAML
146
+ added: v0.1.3
147
+ -->
103
148
104
149
Print v8 command line options.
105
150
106
151
107
152
### ` --tls-cipher-list=list `
153
+ <!-- YAML
154
+ added: v4.0.0
155
+ -->
108
156
109
157
Specify an alternative default TLS cipher list. (Requires Node.js to be built
110
158
with crypto support. (Default))
@@ -123,36 +171,54 @@ Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.)
123
171
124
172
125
173
### ` --icu-data-dir=file `
174
+ <!-- YAML
175
+ added: v0.11.15
176
+ -->
126
177
127
178
Specify ICU data load path. (overrides ` NODE_ICU_DATA ` )
128
179
129
180
130
181
## Environment Variables
131
182
132
183
### ` NODE_DEBUG=module[,…] `
184
+ <!-- YAML
185
+ added: v0.1.32
186
+ -->
133
187
134
188
` ',' ` -separated list of core modules that should print debug information.
135
189
136
190
137
191
### ` NODE_PATH=path[:…] `
192
+ <!-- YAML
193
+ added: v0.1.32
194
+ -->
138
195
139
196
` ':' ` -separated list of directories prefixed to the module search path.
140
197
141
198
_ Note: on Windows, this is a ` ';' ` -separated list instead._
142
199
143
200
144
201
### ` NODE_DISABLE_COLORS=1 `
202
+ <!-- YAML
203
+ added: v0.3.0
204
+ -->
145
205
146
206
When set to ` 1 ` colors will not be used in the REPL.
147
207
148
208
149
209
### ` NODE_ICU_DATA=file `
210
+ <!-- YAML
211
+ added: v0.11.15
212
+ -->
150
213
151
214
Data path for ICU (Intl object) data. Will extend linked-in data when compiled
152
215
with small-icu support.
153
216
154
217
155
218
### ` NODE_REPL_HISTORY=file `
219
+ <!-- YAML
220
+ added: v3.0.0
221
+ -->
156
222
157
223
Path to the file used to store the persistent REPL history. The default path is
158
224
` ~/.node_repl_history ` , which is overridden by this variable. Setting the value
0 commit comments