Skip to content

Check if the operating system CPU architecture is 64-bit or 32-bit (Supports browsers)

License

Notifications You must be signed in to change notification settings

sindresorhus/is64bit

Repository files navigation

is64bit

Check if the operating system CPU architecture is 64-bit or 32-bit

This package also works in the browser. It can be useful to serve the correct binary for download.

On Node.js, process.arch / os.arch() is generally not useful as it returns the CPU architecture for which the Node.js binary was compiled, not the actual system architecture.

Install

npm install is64bit

Usage

import {is64bit} from 'is64bit';

// On ARM64 macOS
console.log(await is64bit());
//=> true

API

is64bit()

Returns a Promise<boolean> for whether the operating system CPU architecture is 64-bit.

is64bitSync()

Returns a boolean for whether the operating system CPU architecture is 64-bit.

Note: Prefer the async version for browser or cross-platform usage as it has a more reliable check.

Related

About

Check if the operating system CPU architecture is 64-bit or 32-bit (Supports browsers)

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published