Skip to content

isDev

isDev(): boolean

Defined in: internal/dev.ts:15

Internal

Dev-mode predicate. Returns true unless process.env.NODE_ENV is "production".

The bare process.env.NODE_ENV token is read on purpose: bundlers (Vite, esbuild, webpack) replace exactly that token with a string literal at build time, so a production build folds the predicate to false in a browser as well as in Node. A typeof process guard would defeat the fold, because after replacement it would be the only reference to process left and a browser has none. Loading the packages in a browser without a bundler is not supported and throws a ReferenceError on the first call.

boolean

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/core.md.