isBrowser es-toolkit
Checks if the current execution environment is a browser.
Usage
isBrowser()
Use isBrowser when you have code that should only run in browser environments. It determines if the environment is a browser by checking for the existence of window.document. Useful in SSR (Server-Side Rendering) or Node.js environments.
Can be used to implement conditional logic based on the environment.
Particularly useful in SSR frameworks like Next.js or Nuxt.js.
Returns
Returns true if the current environment is a browser, false otherwise.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.