Identifying The JS Runtime by Code
Node.js popularised the concept of running JavaScript on the server. There are more JavaScript runtimes intended for building server-based applications today, with Bun and LLRT being the most recent I'm aware of. Some of these runtimes have adopted Web Platform APIs to allow the same API to be used both in the browser and the server (e.g. web crypto API), however, they also have runtime-specific APIs.
You might want to check if your code is running on a specific runtime before using its unique A...
Read more at blog.vite.host