2222 * @module env
2323 */
2424
25- import fs from 'fs' ;
26- import path from 'path' ;
27- import url from 'url' ;
25+ import fs from 'node: fs' ;
26+ import path from 'node: path' ;
27+ import url from 'node: url' ;
2828
2929const VERSION = '3.5.2' ;
3030
@@ -40,6 +40,10 @@ const IS_NODE_ENV = IS_PROCESS_AVAILABLE && process?.release?.name === 'node';
4040const IS_FS_AVAILABLE = ! isEmpty ( fs ) ;
4141const IS_PATH_AVAILABLE = ! isEmpty ( path ) ;
4242
43+ // Runtime detection
44+ const IS_DENO_RUNTIME = typeof globalThis . Deno !== 'undefined' ;
45+ const IS_BUN_RUNTIME = typeof globalThis . Bun !== 'undefined' ;
46+
4347/**
4448 * A read-only object containing information about the APIs available in the current environment.
4549 */
@@ -62,7 +66,7 @@ export const apis = Object.freeze({
6266 /** Whether the Node.js process API is available */
6367 IS_PROCESS_AVAILABLE ,
6468
65- /** Whether we are running in a Node.js environment */
69+ /** Whether we are running in a Node.js-like environment (node, deno, bun) */
6670 IS_NODE_ENV ,
6771
6872 /** Whether the filesystem API is available */
@@ -143,7 +147,7 @@ export const env = {
143147 useFS : IS_FS_AVAILABLE ,
144148
145149 /////////////////// Cache settings ///////////////////
146- useBrowserCache : IS_WEB_CACHE_AVAILABLE ,
150+ useBrowserCache : IS_WEB_CACHE_AVAILABLE && ! IS_DENO_RUNTIME ,
147151
148152 useFSCache : IS_FS_AVAILABLE ,
149153 cacheDir : DEFAULT_CACHE_DIR ,
0 commit comments