
Security News
npm Introduces minimumReleaseAge and Bulk OIDC Configuration
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.
Detect CPU architecture (not process architecture).
Handles emulation scenarios where process.arch returns the wrong value:
x64arm64arm64npm install cpu-arch
const cpuArch = require('cpu-arch');
console.log(cpuArch());
// => 'x64', 'arm64', 'ia32', 'arm', etc.
process.arch?process.arch returns the architecture of the Node.js binary, not the CPU:
| Scenario | process.arch | cpuArch() |
|---|---|---|
| 32-bit Node on 64-bit Windows | ia32 | x64 |
| x64 Node on Apple Silicon (Rosetta) | x64 | arm64 |
| Native arm64 Node on Apple Silicon | arm64 | arm64 |
This matters when selecting native binaries (e.g., @swc/core, Node.js downloads).
| Value | Description |
|---|---|
x64 | 64-bit Intel/AMD |
arm64 | 64-bit ARM (Apple Silicon, ARM64 Windows/Linux) |
ia32 | 32-bit Intel/AMD |
arm | 32-bit ARM |
ia64 | Intel Itanium |
| Other | Raw uname -m output (ppc64, s390x, etc.) |
| Platform | Method |
|---|---|
| Windows | PROCESSOR_ARCHITEW6432 / PROCESSOR_ARCHITECTURE env vars |
| macOS | sysctl -in sysctl.proc_translated for Rosetta detection |
| Linux | uname -m |
MIT
FAQs
Detect CPU architecture (handles WoW64, Rosetta 2, ARM64)
The npm package cpu-arch receives a total of 78 weekly downloads. As such, cpu-arch popularity was classified as not popular.
We found that cpu-arch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.

Research
/Security News
Socket uncovered four malicious NuGet packages targeting ASP.NET apps, using a typosquatted dropper and localhost proxy to steal Identity data and backdoor apps.