Socket
Socket
Sign inDemoInstall

system-architecture

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

system-architecture

Get the operating system CPU architecture


Version published
Maintainers
0
Created
Source

system-architecture

Get the operating system CPU architecture

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.

For browser usage, you probably want is64bit instead.

Install

npm install system-architecture

Usage

import {systemArchitecture} from 'system-architecture';

// On ARM64 macOS
console.log(await systemArchitecture());
//=> 'arm64'

API

systemArchitecture()

Returns a promise for a CPU architecture name. See process.arch for possible values.

systemArchitectureSync()

Returns a CPU architecture name. See process.arch for possible values.

Note

This should really be in Node.js core, but they are not pragmatic.

  • is64bit - Check whether operating system CPU architecture is 64-bit or 32-bit

Keywords

FAQs

Package last updated on 18 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc