Running STRVCT applications natively in Node.js without DOM or browser dependencies.
STRVCT's domain model layer, persistence engine, and boot sequence execute natively in Node.js. The same application domain classes that run in the browser run headlessly under Node.js—with identical storage behavior, slot metadata annotations, and object lifecycles—just without DOM or view classes.
This enables ultra-fast unit/integration testing, server-side processing, batch simulations, and CLI tools.
// Environment checks
if (SvPlatform.isNodePlatform()) {
// Node.js specific code
} else if (SvPlatform.isBrowserPlatform()) {
// Browser specific code
}During boot resource discovery, StrvctFile.canUseInCurrentEnv() inspects path segments:
browser-only/ paths are skipped.server-only/ paths are skipped.This convention provides environment-specific implementations of the exact same class interface:
source/boot/browser-only/SvIndexedDbFolder.js # Uses native IndexedDB
source/boot/server-only/SvIndexedDbFolder.js # Uses LevelDB via classic-levelIn source/library/ideal/categories/server-only/:
| Shim File | Browser API Polyfilled | Node.js Implementation |
|---|---|---|
XMLHttpRequestShim.js | XMLHttpRequest | Wraps xhr2 package |
FileReaderShim.js | FileReader | Reads ArrayBuffer and text from Blobs |
ImageShim.js | Image, HTMLCanvasElement | Wraps canvas package |
FontFaceShim.js | FontFace | Stub accepting font declarations |
Storage works identically in both environments through SvIndexedDbFolder:
classic-level) in ./data/leveldb/.SvApp startup and readiness promises.