Installation
Install @taucad/runtime and configure it for your project.
Installation
Install @taucad/runtime and its peer dependencies to start using the multi-kernel CAD runtime in your project.
Prerequisites
- Node.js 20 or later
- A package manager: npm, pnpm, or yarn
Install the Package
pnpm add @taucad/runtimeFramework Configuration
Vite
@taucad/runtime uses Web Workers for kernel isolation. Vite handles worker URLs natively via new URL(..., import.meta.url):
import { createRuntimeClient, presets } from '@taucad/runtime';
const client = createRuntimeClient(presets.all());Node.js
For server-side usage, workers run as Node.js worker threads. Use fromNodeFS for filesystem access:
import { createRuntimeClient } from '@taucad/runtime';
import { fromNodeFS } from '@taucad/runtime/filesystem/node';
import { replicad } from '@taucad/runtime/kernels';
import { esbuild } from '@taucad/runtime/bundler';
const client = createRuntimeClient({
kernels: [replicad()],
bundlers: [esbuild()],
fileSystem: fromNodeFS('/path/to/project'),
});Subpath Imports
The package exposes multiple subpath imports for tree-shaking:
| Import Path | Contents |
|---|---|
@taucad/runtime | Client, presets, fromMemoryFS, fromFsLike, plugin factories, error types, core types |
@taucad/runtime/kernels | Kernel factories (replicad, opencascade, manifold, openscad, jscad, zoo, tau) |
@taucad/runtime/middleware | defineMiddleware and built-in middleware factories |
@taucad/runtime/bundler | defineBundler and esbuild bundler factory |
@taucad/runtime/transport | Transport layer (createWorkerTransport, createInProcessTransport) |
@taucad/runtime/filesystem | fromNodeFS (Node.js-only), plus fromMemoryFS, fromFsLike, bridge utilities |
@taucad/runtime/types | All TypeScript type exports |
@taucad/runtime/testing | Testing utilities for kernel and middleware development |
@taucad/runtime/worker | Runtime worker entry point (KernelRuntimeWorker) |
fromMemoryFS and fromFsLike are available from both the main @taucad/runtime entry and @taucad/runtime/filesystem. fromNodeFS is only available from @taucad/runtime/filesystem because it depends on Node.js APIs.
What's Next
- Quick Start -- Render your first 3D model in under 4 minutes
- API Reference: Client -- Full API documentation for
createRuntimeClient