# @arcjet/runtime

> Arcjet runtime detection

Latest version **1.14.1** (published 2026-10-07) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @arcjet/runtime
pnpm add @arcjet/runtime
yarn add @arcjet/runtime
bun add @arcjet/runtime
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.14.1 |
| Published | 2026-10-07 |
| First published | 2024-06-10 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.21.0 <23 \|\| >=24.5.0 |
| Dependencies | 0 |
| Unpacked size | 17 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 685 |
| Author | Arcjet |
| Maintainers | quinn-arcjet, davidmytton |
| Keywords | arcjet, detect, runtime, util, utility |

## Links

- npm: https://www.npmjs.com/package/@arcjet/runtime
- Repository: https://github.com/arcjet/arcjet-js
- Homepage: https://arcjet.com
- Issues: https://github.com/arcjet/arcjet-js/issues
- npm.io page: https://npm.io/package/@arcjet/runtime

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.14.1 (latest) — 2026-10-07
- 1.10.0-rc.1 (rc) — 2026-08-07
- 1.14.0 — 2026-10-01
- 1.13.0 — 2026-09-16
- 1.12.0 — 2026-09-08
- 1.11.0 — 2026-08-26
- 1.10.0 — 2026-08-11
- 1.10.0-rc.0 — 2026-08-04
- 1.9.1 — 2026-07-15
- 1.9.0 — 2026-07-15
- 1.8.0 — 2026-07-07
- 1.8.0-rc.0 — 2026-07-07
- 1.7.0 — 2026-07-06
- 1.7.0-rc.1 — 2026-07-06
- 1.7.0-rc.0 — 2026-07-03
- … 49 more at https://npm.io/package/@arcjet/runtime/versions

## README

<!-- trunk-ignore-all(markdownlint/MD001) -->

<a href="https://arcjet.com" target="_arcjet-home">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://arcjet.com/logo/arcjet-dark-lockup-voyage-horizontal.svg">
    <img src="https://arcjet.com/logo/arcjet-light-lockup-voyage-horizontal.svg" alt="Arcjet Logo" height="128" width="auto">
  </picture>
</a>

# `@arcjet/runtime`

<p>
  <a href="https://www.npmjs.com/package/@arcjet/runtime">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/v/%40arcjet%2Fruntime?style=flat-square&label=%E2%9C%A6Aj&labelColor=000000&color=5C5866">
      <img alt="npm badge" src="https://img.shields.io/npm/v/%40arcjet%2Fruntime?style=flat-square&label=%E2%9C%A6Aj&labelColor=ECE6F0&color=ECE6F0">
    </picture>
  </a>
</p>

[Arcjet][arcjet] runtime detection.

This package attempts to discover and provide [runtime keys][runtime-keys] as
defined by the [WinterCG][wintercg].

- [npm package (`@arcjet/runtime`)](https://www.npmjs.com/package/@arcjet/runtime)
- [GitHub source code (`runtime/` in `arcjet/arcjet-js`)](https://github.com/arcjet/arcjet-js/tree/main/runtime)

## What is this?

This is an internal utility to help us figure out what platform we are running on.
It’s a fork of [`unjs/std-env`][std-env].
We chose to fork so that we can cut away functionality that we do not use
and keep our dependency tree as light as possible.
We only need the runtime detection.

## When should I use this?

You should not use this but use [`unjs/std-env`][std-env] or one of the
alternatives instead.
This package matches our current needs which are likely different from yours.

## Install

This package is ESM only.
Install with npm in Node.js:

```sh
npm install @arcjet/runtime
```

## Use

```ts
import { runtime } from "@arcjet/runtime";

console.log(runtime()); // => "bun" or "node" and such
```

## API

This package exports the identifier
[`runtime`][api-runtime].
There is no default export.

This package exports the [TypeScript][] type [`Runtime`][api-runtime-type].

### `Runtime`

This type represents the runtime environments that can be detected.

###### Type

```ts
type Runtime = "workerd" | "deno" | "node" | "bun" | "edge-light" | "";
```

### `runtime()`

Detects which runtime environment your code is currently running in.

###### Returns

The detected runtime (`string`), or an empty string if the runtime could not
be determined.

## License

[Apache License, Version 2.0][apache-license] © [Arcjet Labs, Inc.][arcjet]

Derivative work based on [`std-env`][std-env] licensed under
[MIT][std-env-license] © Pooya Parsa.
Our work cherry picks only what we need.

[apache-license]: http://www.apache.org/licenses/LICENSE-2.0
[api-runtime-type]: #runtime
[api-runtime]: #runtime-1
[arcjet]: https://arcjet.com
[runtime-keys]: https://runtime-keys.proposal.wintercg.org/
[wintercg]: https://wintercg.org/
[std-env-license]: https://github.com/unjs/std-env/blob/7e8cb7b/LICENCE
[std-env]: https://github.com/unjs/std-env/blob/d57a5d8/src/runtimes.ts
[typescript]: https://www.typescriptlang.org/

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