@arcjet/runtime
Advanced tools
+1
-1
@@ -9,4 +9,4 @@ /** | ||
| * @returns | ||
| * Runtime. | ||
| * Runtime; empty string if not found. | ||
| */ | ||
| export declare function runtime(): Runtime; |
+1
-1
@@ -29,3 +29,3 @@ // This code was improved by detection mechanisms in | ||
| * @returns | ||
| * Runtime. | ||
| * Runtime; empty string if not found. | ||
| */ | ||
@@ -32,0 +32,0 @@ function runtime() { |
+5
-5
| { | ||
| "name": "@arcjet/runtime", | ||
| "version": "1.3.0", | ||
| "version": "1.3.1", | ||
| "description": "Arcjet runtime detection", | ||
@@ -53,6 +53,6 @@ "keywords": [ | ||
| "devDependencies": { | ||
| "@arcjet/eslint-config": "1.3.0", | ||
| "@arcjet/rollup-config": "1.3.0", | ||
| "@rollup/wasm-node": "4.57.1", | ||
| "eslint": "9.39.2", | ||
| "@arcjet/eslint-config": "1.3.1", | ||
| "@arcjet/rollup-config": "1.3.1", | ||
| "@rollup/wasm-node": "4.59.0", | ||
| "eslint": "9.39.3", | ||
| "typescript": "5.9.3" | ||
@@ -59,0 +59,0 @@ }, |
+32
-0
@@ -0,1 +1,3 @@ | ||
| <!-- trunk-ignore-all(markdownlint/MD001) --> | ||
| <a href="https://arcjet.com" target="_arcjet-home"> | ||
@@ -58,2 +60,29 @@ <picture> | ||
| ## 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 | ||
@@ -68,2 +97,4 @@ | ||
| [apache-license]: http://www.apache.org/licenses/LICENSE-2.0 | ||
| [api-runtime-type]: #runtime | ||
| [api-runtime]: #runtime-1 | ||
| [arcjet]: https://arcjet.com | ||
@@ -74,1 +105,2 @@ [runtime-keys]: https://runtime-keys.proposal.wintercg.org/ | ||
| [std-env]: https://github.com/unjs/std-env/blob/d57a5d8/src/runtimes.ts | ||
| [typescript]: https://www.typescriptlang.org/ |
20835
3.75%104
44.44%