Skip to content

UseIsNode

katanakit-js / 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.

boolean

true when process.versions.node is available.

import { useIsNode } from "katanakit-js";
if (useIsNode()) {
// safe to use node:fs / node:path
}