1. is64bit
Check whether operating system CPU architecture is 64-bit or 32-bit (Supports browsers)
is64bit
Package: is64bit
Created by: sindresorhus
Last modified: Mon, 23 Oct 2023 07:58:57 GMT
Version: 2.0.0
License: MIT
Downloads: 3,014,501
Repository: https://github.com/sindresorhus/is64bit

Install

npm install is64bit
yarn add is64bit

is64bit

Check whether 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 POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code