Socket
Socket
Sign inDemoInstall

system-architecture

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    system-architecture

Get the operating system CPU architecture


Version published
Weekly downloads
749K
increased by1.92%
Maintainers
1
Install size
5.25 kB
Created
Weekly downloads
 

Readme

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

Last updated on 23 Oct 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc