Skip to main content

isServer

A function that checks whether the JavaScript runtime environment is a server.

Returns true when in a server environment.


Code

🔗 View source code


Interface

typescript
function isServer(): boolean

Usage

typescript
import { isServer } from '@modern-kit/utils';

if (isServer()) {
/* Node.js environment is guaranteed */
}