UseIsNode
katanakit-js / useIsNode
Function: useIsNode()
Section titled “Function: useIsNode()”function useIsNode(): boolean;Defined in: infrastructure/filesystem/path.service.ts:27
Checks whether the code runs in a Node.js-compatible runtime
(Node, Bun or Deno). Returns false in browsers and edge runtimes.
Returns
Section titled “Returns”boolean
true when process.versions.node is available.
Example
Section titled “Example”import { useIsNode } from "katanakit-js";
if (useIsNode()) { // safe to use node:fs / node:path}