You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -82,13 +82,18 @@ console.log(runtimeInfo);
82
82
83
83
You can also use individual named exports for each runtime detection:
84
84
85
+
> [!NOTE]
86
+
> When running code in Bun and Deno with Node.js compatibility mode, `isNode` flag will be also `true`, indicating running in a Node.js compatible runtime.
87
+
>
88
+
> Use `runtime === "node"` if you need strict check for Node.js runtime.
89
+
90
+
-`isNode`
91
+
-`isBun`
92
+
-`isDeno`
85
93
-`isNetlify`
86
94
-`isEdgeLight`
87
95
-`isWorkerd`
88
-
-`isDeno`
89
96
-`isLagon`
90
-
-`isNode`
91
-
-`isBun`
92
97
-`isFastly`
93
98
94
99
List of well known providers can be found from [./src/runtimes.ts](./src/runtimes.ts).
Copy file name to clipboardExpand all lines: src/runtimes.ts
+44-7Lines changed: 44 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -12,27 +12,64 @@ export type RuntimeName =
12
12
13
13
exporttypeRuntimeInfo={name: RuntimeName};
14
14
15
+
/**
16
+
* Indicates if running in Node.js or a Node.js compatible runtime.
17
+
*
18
+
* **Note:** When running code in Bun and Deno with Node.js compatibility mode, `isNode` flag will be also `true`, indicating running in a Node.js compatible runtime.
19
+
*
20
+
* Use `runtime === "node"` if you need strict check for Node.js runtime.
0 commit comments