@@ -7,16 +7,25 @@ Provides a few basic operating-system related utility functions.
7
7
Use ` require('os') ` to access this module.
8
8
9
9
## os.EOL
10
+ <!-- YAML
11
+ added: v0.7.8
12
+ -->
10
13
11
14
A constant defining the appropriate End-of-line marker for the operating
12
15
system.
13
16
14
17
## os.arch()
18
+ <!-- YAML
19
+ added: v0.5.0
20
+ -->
15
21
16
22
Returns the operating system CPU architecture. Possible values are ` 'x64' ` ,
17
23
` 'arm' ` and ` 'ia32' ` . Returns the value of [ ` process.arch ` ] [ ] .
18
24
19
25
## os.cpus()
26
+ <!-- YAML
27
+ added: v0.3.3
28
+ -->
20
29
21
30
Returns an array of objects containing information about each CPU/core
22
31
installed: model, speed (in MHz), and times (an object containing the number of
@@ -95,23 +104,38 @@ Note that since `nice` values are UNIX centric in Windows the `nice` values of
95
104
all processors are always 0.
96
105
97
106
## os.endianness()
107
+ <!-- YAML
108
+ added: v0.9.4
109
+ -->
98
110
99
111
Returns the endianness of the CPU. Possible values are ` 'BE' ` for big endian
100
112
or ` 'LE' ` for little endian.
101
113
102
114
## os.freemem()
115
+ <!-- YAML
116
+ added: v0.3.3
117
+ -->
103
118
104
119
Returns the amount of free system memory in bytes.
105
120
106
121
## os.homedir()
122
+ <!-- YAML
123
+ added: v2.3.0
124
+ -->
107
125
108
126
Returns the home directory of the current user.
109
127
110
128
## os.hostname()
129
+ <!-- YAML
130
+ added: v0.3.3
131
+ -->
111
132
112
133
Returns the hostname of the operating system.
113
134
114
135
## os.loadavg()
136
+ <!-- YAML
137
+ added: v0.3.3
138
+ -->
115
139
116
140
Returns an array containing the 1, 5, and 15 minute load averages.
117
141
@@ -124,6 +148,9 @@ Windows platforms. That is why this function always returns `[0, 0, 0]` on
124
148
Windows.
125
149
126
150
## os.networkInterfaces()
151
+ <!-- YAML
152
+ added: v0.6.0
153
+ -->
127
154
128
155
Get a list of network interfaces:
129
156
@@ -156,29 +183,47 @@ Note that due to the underlying implementation this will only return network
156
183
interfaces that have been assigned an address.
157
184
158
185
## os.platform()
186
+ <!-- YAML
187
+ added: v0.5.0
188
+ -->
159
189
160
190
Returns the operating system platform. Possible values are ` 'darwin' ` ,
161
191
` 'freebsd' ` , ` 'linux' ` , ` 'sunos' ` or ` 'win32' ` . Returns the value of
162
192
[ ` process.platform ` ] [ ] .
163
193
164
194
## os.release()
195
+ <!-- YAML
196
+ added: v0.3.3
197
+ -->
165
198
166
199
Returns the operating system release.
167
200
168
201
## os.tmpdir()
202
+ <!-- YAML
203
+ added: v0.9.9
204
+ -->
169
205
170
206
Returns the operating system's default directory for temporary files.
171
207
172
208
## os.totalmem()
209
+ <!-- YAML
210
+ added: v0.3.3
211
+ -->
173
212
174
213
Returns the total amount of system memory in bytes.
175
214
176
215
## os.type()
216
+ <!-- YAML
217
+ added: v0.3.3
218
+ -->
177
219
178
220
Returns the operating system name. For example ` 'Linux' ` on Linux, ` 'Darwin' `
179
221
on OS X and ` 'Windows_NT' ` on Windows.
180
222
181
223
## os.uptime()
224
+ <!-- YAML
225
+ added: v0.3.3
226
+ -->
182
227
183
228
Returns the system uptime in seconds.
184
229
0 commit comments