🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@arcjet/runtime

Package Overview
Dependencies
Maintainers
3
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcjet/runtime - npm Package Compare versions

Comparing version
1.0.0-beta.9
to
1.0.0-beta.10
+7
-7
package.json
{
"name": "@arcjet/runtime",
"version": "1.0.0-beta.9",
"version": "1.0.0-beta.10",
"description": "Arcjet runtime detection",

@@ -54,8 +54,8 @@ "keywords": [

"devDependencies": {
"@arcjet/eslint-config": "1.0.0-beta.9",
"@arcjet/rollup-config": "1.0.0-beta.9",
"@arcjet/tsconfig": "1.0.0-beta.9",
"@rollup/wasm-node": "4.44.2",
"eslint": "9.30.1",
"typescript": "5.8.3"
"@arcjet/eslint-config": "1.0.0-beta.10",
"@arcjet/rollup-config": "1.0.0-beta.10",
"@arcjet/tsconfig": "1.0.0-beta.10",
"@rollup/wasm-node": "4.46.2",
"eslint": "9.32.0",
"typescript": "5.9.2"
},

@@ -62,0 +62,0 @@ "publishConfig": {

+25
-16

@@ -27,28 +27,38 @@ <a href="https://arcjet.com" target="_arcjet-home">

## Installation
## What is this?
```shell
npm install -S @arcjet/runtime
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
```
## Example
## Use
```ts
import { runtime, hasWebAssembly } from "@arcjet/runtime";
import { runtime } from "@arcjet/runtime";
runtime() === "node"; // in Node.js
runtime() === "bun"; // in Bun.sh
runtime() === "edge-light"; // in Vercel Edge
runtime() === "workerd"; // in Cloudflare Workers
console.log(runtime()); // => "bun" or "node" and such
```
## Implementation
Improvements of this library were informed by [std-env], which is licensed MIT
with licenses included in our source code.
## License
Licensed under the [Apache License, Version 2.0][apache-license].
[Apache License, Version 2.0][apache-license] © [Arcjet Labs, Inc.][arcjet]
[apache-license]: http://www.apache.org/licenses/LICENSE-2.0
[arcjet]: https://arcjet.com

@@ -58,2 +68,1 @@ [runtime-keys]: https://runtime-keys.proposal.wintercg.org/

[std-env]: https://github.com/unjs/std-env
[apache-license]: http://www.apache.org/licenses/LICENSE-2.0