Node.js Operating System Module

The pack contained all methos of the node js operation system, the cards with methods description and code examples. Start learning process to getting cards direct to your messenger in case to learn NodeJS Operating System Module from scratch or fill up your technical gaps.

You can start studying this pack. You'll receive 128 messages to help you review each card multiple times, following the principles of the forgetting curve.

Learn more about the spaced repetition method.

Schedule daily card reviews to quickly memorize or solidify the knowledge until it becomes second nature.

Learn more about daily practices.
OS

The node:os module provides operating system-related utility methods and properties.

1/32
os.EOL

<string> The operating system-specific end-of-line marker.

2/32
os.availableParallelism()

This function is a small wrapper about libuv's uv_available_parallelism().

3/32
os.arch()

The return value is equivalent to process.arch.

4/32
os.constants

<Object> Contains commonly used operating system-specific constants for error codes, process signals, and so on.


The specific constants defined are described in OS constants.

5/32
os.cpus()

Returns an array of objects containing information about each logical CPU core.

6/32
os.devNull

<string> The platform-specific file path of the null device.

7/32
os.endianness()
Returns: <string> Returns a string identifying the endianness of the CPU for which the Node.js binary was compiled. Possible values are 'BE' for big endian and 'LE' for little endian.
8/32
os.freemem()
Returns: <integer> Returns the amount of free system memory in bytes as an integer.
9/32
os.getPriority([pid])

Returns the scheduling priority for the process specified by pid.


If pid is not provided or is 0, the priority of the current process is returned.

10/32
os.homedir()
Returns: <string> Returns the string path of the current user's home directory. On POSIX, it uses the $HOME environment variable if defined. Otherwise it uses the effective UID to look up the user's home directory.
11/32
os.hostname()
Returns: <string> Returns the host name of the operating system as a string.
12/32
os.loadavg()
Returns: <number[]> Returns an array containing the 1, 5, and 15 minute load averages. The load average is a measure of system activity calculated by the operating system and expressed as a fractional number.
13/32
os.machine()
Returns: <string> Returns the machine type as a string, such as arm, arm64, aarch64, mips, mips64, ppc64, ppc64le, s390, s390x, i386, i686, x86_64.
14/32
os.networkInterfaces()
Returns: <Object> Returns an object containing network interfaces that have been assigned a network address. Each key on the returned object identifies a network interface. The associated value is an array of objects that each describe an assigned network address. eslint-skip
15/32
os.platform()
Returns: <string> Returns a string identifying the operating system platform for which the Node.js binary was compiled. The value is set at compile time. Possible values are 'aix', 'darwin', 'freebsd','linux', 'openbsd', 'sunos', and 'win32'.
16/32
os.release()
Returns: <string> Returns the operating system as a string. On POSIX systems, the operating system release is determined by calling uname(3). On Windows, GetVersionExW() is used. See https://en.wikipedia.org/wiki/Uname#Examples for more information.
17/32
os.setPriority([pid, ]priority)
pid <integer> The process ID to set scheduling priority for. Default: 0. priority <integer> The scheduling priority to assign to the process.
18/32
os.tmpdir()
Returns: <string> Returns the operating system's default directory for temporary files as a string.
19/32
os.totalmem()
Returns: <integer> Returns the total amount of system memory in bytes as an integer.
20/32
os.type()
Returns: <string> Returns the operating system name as returned by uname(3). For example, it returns 'Linux' on Linux, 'Darwin' on macOS, and 'Windows_NT' on Windows.
21/32
os.uptime()
Returns: <integer> Returns the system uptime in number of seconds.
22/32
os.userInfo([options])
options <Object> encoding <string> Character encoding used to interpret resulting strings. If encoding is set to 'buffer', the username, shell, and homedir values will be Buffer instances. Default: 'utf8'.
23/32
os.version()
Returns: <string> Returns a string identifying the kernel version.
24/32
OS constants
The following constants are exported by os.constants. Not all constants will be available on every operating system.
25/32
Signal constants
History Version Changes v5.11.0 Added support for SIGINFO. The following signal constants are exported by os.constants.signals. Constant Description
26/32
Error constants
The following error constants are exported by os.constants.errno.
27/32
POSIX error constants
Constant Description
28/32
Windows-specific error constants
The following error codes are specific to the Windows operating system. Constant Description
29/32
dlopen constants
If available on the operating system, the following constants are exported in os.constants.dlopen. See dlopen(3) for detailed information. Constant Description
30/32
Priority constants
The following process scheduling constants are exported by os.constants.priority. Constant Description
31/32
libuv constants
Constant Description
32/32
WitSlice © 2026