# system-architecture

> Get the operating system CPU architecture

Latest version **1.0.0** (published 2024-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install system-architecture
pnpm add system-architecture
yarn add system-architecture
bun add system-architecture
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2024-08-18 |
| First published | 2023-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 46 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | arch, architecture, cpu, arm64, arm, x64, x86, 64-bit, 32-bit, bitness, detect, check |

## Links

- npm: https://www.npmjs.com/package/system-architecture
- Repository: https://github.com/sindresorhus/system-architecture
- Homepage: https://github.com/sindresorhus/system-architecture#readme
- Issues: https://github.com/sindresorhus/system-architecture/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/system-architecture

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2024-08-18
- 0.1.0 — 2023-10-23

## README

# system-architecture

> Get the operating system CPU architecture

[`process.arch` / `os.arch()`](https://nodejs.org/api/process.html#processarch) 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`](https://github.com/sindresorhus/is64bit) instead.

## Install

```sh
npm install system-architecture
```

## Usage

```js
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`](https://nodejs.org/api/process.html#processarch) for possible values.

### systemArchitectureSync()

Returns a CPU architecture name. See [`process.arch`](https://nodejs.org/api/process.html#processarch) for possible values.

## Note

This should really be in Node.js core, but they are [not pragmatic](https://github.com/nodejs/node/issues/17036).

## Related

- [is64bit](https://github.com/sindresorhus/is64bit) - Check whether operating system CPU architecture is 64-bit or 32-bit

---
_Source: https://npm.io/package/system-architecture · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
