isServer

isServer

Returns true when runtime is a server-side

Import

import { isServer } from '@fullstacksjs/toolbox';

Signature

function isServer(): boolean {}

Examples

if (isServer()) console.log('This runs in server environment');
if (!isServer()) alert('I will run in the client only');