@@ -6,67 +6,16 @@ Provides a few basic operating-system related utility functions.
6
6
7
7
Use ` require('os') ` to access this module.
8
8
9
- ## os.tmpdir()
10
-
11
- Returns the operating system's default directory for temporary files.
12
-
13
- ## os.homedir()
14
-
15
- Returns the home directory of the current user.
16
-
17
- ## os.endianness()
18
-
19
- Returns the endianness of the CPU. Possible values are ` 'BE' ` for big endian
20
- or ` 'LE' ` for little endian.
21
-
22
- ## os.hostname()
23
-
24
- Returns the hostname of the operating system.
25
-
26
- ## os.type()
27
-
28
- Returns the operating system name. For example ` 'Linux' ` on Linux, ` 'Darwin' `
29
- on OS X and ` 'Windows_NT' ` on Windows.
30
-
31
- ## os.platform()
9
+ ## os.EOL
32
10
33
- Returns the operating system platform. Possible values are ` 'darwin' ` ,
34
- ` 'freebsd' ` , ` 'linux' ` , ` 'sunos' ` or ` 'win32' ` . Returns the value of
35
- ` process.platform ` .
11
+ A constant defining the appropriate End-of-line marker for the operating
12
+ system.
36
13
37
14
## os.arch()
38
15
39
16
Returns the operating system CPU architecture. Possible values are ` 'x64' ` ,
40
17
` 'arm' ` and ` 'ia32' ` . Returns the value of ` process.arch ` .
41
18
42
- ## os.release()
43
-
44
- Returns the operating system release.
45
-
46
- ## os.uptime()
47
-
48
- Returns the system uptime in seconds.
49
-
50
- ## os.loadavg()
51
-
52
- Returns an array containing the 1, 5, and 15 minute load averages.
53
-
54
- The load average is a measure of system activity, calculated by the operating
55
- system and expressed as a fractional number. As a rule of thumb, the load
56
- average should ideally be less than the number of logical CPUs in the system.
57
-
58
- The load average is a very UNIX-y concept; there is no real equivalent on
59
- Windows platforms. That is why this function always returns ` [0, 0, 0] ` on
60
- Windows.
61
-
62
- ## os.totalmem()
63
-
64
- Returns the total amount of system memory in bytes.
65
-
66
- ## os.freemem()
67
-
68
- Returns the amount of free system memory in bytes.
69
-
70
19
## os.cpus()
71
20
72
21
Returns an array of objects containing information about each CPU/core
@@ -143,6 +92,35 @@ Example inspection of os.cpus:
143
92
Note that since ` nice ` values are UNIX centric in Windows the ` nice ` values of
144
93
all processors are always 0.
145
94
95
+ ## os.endianness()
96
+
97
+ Returns the endianness of the CPU. Possible values are ` 'BE' ` for big endian
98
+ or ` 'LE' ` for little endian.
99
+
100
+ ## os.freemem()
101
+
102
+ Returns the amount of free system memory in bytes.
103
+
104
+ ## os.homedir()
105
+
106
+ Returns the home directory of the current user.
107
+
108
+ ## os.hostname()
109
+
110
+ Returns the hostname of the operating system.
111
+
112
+ ## os.loadavg()
113
+
114
+ Returns an array containing the 1, 5, and 15 minute load averages.
115
+
116
+ The load average is a measure of system activity, calculated by the operating
117
+ system and expressed as a fractional number. As a rule of thumb, the load
118
+ average should ideally be less than the number of logical CPUs in the system.
119
+
120
+ The load average is a very UNIX-y concept; there is no real equivalent on
121
+ Windows platforms. That is why this function always returns ` [0, 0, 0] ` on
122
+ Windows.
123
+
146
124
## os.networkInterfaces()
147
125
148
126
Get a list of network interfaces:
@@ -173,7 +151,29 @@ Get a list of network interfaces:
173
151
Note that due to the underlying implementation this will only return network
174
152
interfaces that have been assigned an address.
175
153
176
- ## os.EOL
154
+ ## os.platform()
177
155
178
- A constant defining the appropriate End-of-line marker for the operating
179
- system.
156
+ Returns the operating system platform. Possible values are ` 'darwin' ` ,
157
+ ` 'freebsd' ` , ` 'linux' ` , ` 'sunos' ` or ` 'win32' ` . Returns the value of
158
+ ` process.platform ` .
159
+
160
+ ## os.release()
161
+
162
+ Returns the operating system release.
163
+
164
+ ## os.tmpdir()
165
+
166
+ Returns the operating system's default directory for temporary files.
167
+
168
+ ## os.totalmem()
169
+
170
+ Returns the total amount of system memory in bytes.
171
+
172
+ ## os.type()
173
+
174
+ Returns the operating system name. For example ` 'Linux' ` on Linux, ` 'Darwin' `
175
+ on OS X and ` 'Windows_NT' ` on Windows.
176
+
177
+ ## os.uptime()
178
+
179
+ Returns the system uptime in seconds.
0 commit comments