Node.OS
- Package
- purescript-node-os
- Repository
- purescript-node/purescript-node-os
#CPU Source
type CPU = { model :: String, speed :: Int, times :: { idle :: Milliseconds, irq :: Milliseconds, nice :: Milliseconds, sys :: Milliseconds, user :: Milliseconds } }
#endianness Source
endianness :: Effect Endianness
Identifies the endianness of the CPU for which the Node.js binary was compiled.
#toNodeEndianness Source
toNodeEndianness :: Endianness -> String
#getCurrentProcessPriority Source
getCurrentProcessPriority :: Effect Int
Returns the scheduling priority for the current process.
#getPriority Source
getPriority :: Pid -> Effect Int
Returns the scheduling priority for the process specified by pid.
#NetworkInterface Source
type NetworkInterface = { address :: String, cidr :: Maybe String, family :: IpVersion, internal :: Boolean, mac :: String, netmask :: String, scopeId :: Maybe Int }
- address - The assigned IPv4 or IPv6 address
- netmask - The IPv4 or IPv6 network mask
- mac - The MAC address of the network interface
- internal - true if the network interface is a loopback or similar interface that is not remotely accessible; otherwise false
Conditional fields:
- cidr - The assigned IPv4 or IPv6 address with the routing prefix in CIDR notation. If the netmask is invalid, this property is set to null.
- scopeid - The numeric IPv6 scope ID (only specified when family is IPv6)
#networkInterfaces Source
networkInterfaces :: Effect (Object (Array NetworkInterface))
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.
#setPriority Source
setPriority :: Pid -> Int -> Effect Unit
Attempts to set the scheduling priority for the process specified by pid.
Note: all inputs are clamped to a valid value (i.e. -20
= high priority and 19
= low priority).
Due to differences between Unix priority levels and Windows priority classes,
priority is mapped to one of six priority constants in os.constants.priority
.
When retrieving a process priority level, this range mapping may cause the return value to be slightly different
on Windows. To avoid confusion, set priority to one of the priority constants.
On Windows, setting priority to PRIORITY_HIGHEST
requires elevated user privileges.
Otherwise the set priority will be silently reduced to PRIORITY_HIGH
.
#userInfo Source
userInfo :: Effect (UserInfo String)
Returns information about the currently effective user.
- On POSIX platforms, this is typically a subset of the password file. The returned object includes the username, uid, gid, shell, and homedir.
- On Windows, the uid and gid fields are -1, and shell is null.
Note: The value of homedir
returned here is provided by the operating system.
This differs from the result of os.homedir()
,
which queries environment variables for the home directory before falling back
to the operating system response.
Note: This can throw a SystemError. If that's relevant to you, use userInfoSE
and friends.
#userInfoSE Source
userInfoSE :: Effect (Either SystemError (UserInfo String))
A variant of userInfo
that catches the thrown SystemError
when username
or homedir
are undefined for the given user.
#userInfoSE' Source
userInfoSE' :: Encoding -> Effect (Either SystemError (UserInfo String))
- Modules
- Node.
Errors. SystemError - Node.
OS