Y
Hacker News
new
|
ask
|
show
|
jobs
by
antipurist
904 days ago
Something like
if ('Bun' in globalThis) ... if ('Deno' in globalThis) ... if ('window' in globalThis) ...
could be used to determine the runtime.
1 comments
timw4mail
904 days ago
That certainly works for Bun and Deno, not sure about what is effective in Node, though.
link
basil-rash
904 days ago
Checking for process.versions.{node,bun} works, not sure if Deno has an equivalent.
link