Skip to content
Node: os9 APIs

osutil

Package osutil exposes host and OS information. Node equivalent: os module helpers.

import "github.com/sahilkhaire/gox/osutil"
## API reference

Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.

Functions

SymbolNode.jsKindSummary
Archprocess.archfuncArch returns the architecture (runtime.GOARCH).
CPUsos.cpus().lengthfuncCPUs returns the number of logical CPUs.
Homediros.homedir()funcHomedir returns the current user's home directory.
Hostnameos.hostname()funcHostname returns the host name.
Platformprocess.platformfuncPlatform returns the OS (runtime.GOOS).
TempDiros.tmpdir()funcTempDir returns the default temp directory.
UserInfoNumericfuncUserInfoNumeric is like UserInfo but parses uid/gid as ints when possible.

Types

SymbolNode.jsKindSummary
UsertypeUser holds user identity fields when available (os.userInfo).

Methods

SymbolNode.jsKindSummary
User.UserInfoos.userInfo()methodUserInfo returns the current user.

MIT Licensed · Built for Node.js developers moving to Go