NPM.Os (NPM v0.6.0)

Copy Markdown View Source

Checks package os/cpu field compatibility.

npm packages can restrict which platforms they support via the os and cpu fields in package.json. Delegates to NPM.Platform for actual OS/CPU detection.

Summary

Functions

Scans packages for platform incompatibilities.

Checks both os and cpu compatibility.

Checks if the current CPU is compatible with a package's cpu field.

Returns the current CPU architecture (npm convention).

Returns the current operating system name (npm convention).

Checks if the current OS is compatible with a package's os field.

Functions

check_all(node_modules_dir)

@spec check_all(String.t()) :: [%{name: String.t(), reason: String.t()}]

Scans packages for platform incompatibilities.

compatible?(pkg_data)

@spec compatible?(map()) :: boolean()

Checks both os and cpu compatibility.

cpu_compatible?(arg1)

@spec cpu_compatible?(map()) :: boolean()

Checks if the current CPU is compatible with a package's cpu field.

current_cpu()

@spec current_cpu() :: String.t()

Returns the current CPU architecture (npm convention).

current_os()

@spec current_os() :: String.t()

Returns the current operating system name (npm convention).

os_compatible?(arg1)

@spec os_compatible?(map()) :: boolean()

Checks if the current OS is compatible with a package's os field.