3 ms·
Something like if ('Bun' in globalThis) ... if ('Deno' in globalThis) ... if ('window' in globalThis) ... could be used to determine the runtime.
by antipurist 3y ago
Something like
if ('Bun' in globalThis) ...
if ('Deno' in globalThis) ...
if ('window' in globalThis) ...
could be used to determine the runtime.
- timw4mail 3y agoThat certainly works for Bun and Deno, not sure about what is effective in Node, though.
- basil-rash 3y agoChecking for process.versions.{node,bun} works, not sure if Deno has an equivalent.
- deleted 3y ago[deleted]