Skip to main content

Node

import { getNodeMajorVersion, getProcessUptime, isNode } from '@rtorcato/js-common/node'

Exports

NameSummary
getNodeMajorVersionReturns the current Node.js major version as a number.
getProcessUptimeReturns the process uptime in seconds.
isNodeChecks if the current environment is Node.js.
nodeVersionCheckChecks if the current Node.js version is less than the specified version.
requireOptionalAttempts to require a module, returning undefined if the module is not found.