@@ -6,67 +6,16 @@ Provides a few basic operating-system related utility functions.
66
77Use ` require('os') ` to access this module.
88
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
3210
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.
3613
3714## os.arch()
3815
3916Returns the operating system CPU architecture. Possible values are ` 'x64' ` ,
4017` 'arm' ` and ` 'ia32' ` . Returns the value of ` process.arch ` .
4118
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-
7019## os.cpus()
7120
7221Returns an array of objects containing information about each CPU/core
@@ -143,6 +92,35 @@ Example inspection of os.cpus:
14392Note that since ` nice ` values are UNIX centric in Windows the ` nice ` values of
14493all processors are always 0.
14594
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+
146124## os.networkInterfaces()
147125
148126Get a list of network interfaces:
@@ -173,7 +151,29 @@ Get a list of network interfaces:
173151Note that due to the underlying implementation this will only return network
174152interfaces that have been assigned an address.
175153
176- ## os.EOL
154+ ## os.platform()
177155
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