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/runtime

Framework 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 PathContents
@taucad/runtimeClient, presets, fromMemoryFS, fromFsLike, plugin factories, error types, core types
@taucad/runtime/kernelsKernel factories (replicad, opencascade, manifold, openscad, jscad, zoo, tau)
@taucad/runtime/middlewaredefineMiddleware and built-in middleware factories
@taucad/runtime/bundlerdefineBundler and esbuild bundler factory
@taucad/runtime/transportTransport layer (createWorkerTransport, createInProcessTransport)
@taucad/runtime/filesystemfromNodeFS (Node.js-only), plus fromMemoryFS, fromFsLike, bridge utilities
@taucad/runtime/typesAll TypeScript type exports
@taucad/runtime/testingTesting utilities for kernel and middleware development
@taucad/runtime/workerRuntime 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