os
Similar to the os module in Node.js, provides some basic system operation functions.
Methods
tmpdir()
Get the default temporary file path of the operating system.
Returns
string
- The default temporary file path of the operating system
version()
Get the string of the operating system kernel version.
Returns
string
- The string of the operating system kernel version
type()
Returns the name of the operating system.
For example: returns Darwin
on macOS, and Windows_NT
on Windows.
Returns
string
- The name of the operating system
release()
Returns the release version of the operating system.
Returns
string
- The release version of the operating system
hostname()
Returns the hostname of the operating system.
Returns
string
- The hostname of the operating system
homedir()
Returns the home directory of the current user.
Returns
string
- The home directory of the current user
arch()
Returns the CPU architecture of the operating system.
Returns
string
- The current CPU architecturex64
arm64
x86
Last updated