Requirements
- Node.js 22.13 or newer for server-side use and repository tooling
- An ESM-capable project
- A modern browser with WebAssembly for client-side evaluation
- TypeScript is recommended but not required by consumers
require("invariantcad") is not a supported
entry path.
Add the package
occt-wasm dependency.
The optional InvariantCAD-owned OCCT facade is not downloaded implicitly and is
not part of the 0.2 npm package.
Confirm ESM configuration
For Node.js, use an ESM source file (.mjs) or mark the consuming package as
ESM:
package.json
TypeScript settings
InvariantCAD targets modern ESM and works best with a modern module resolver:tsconfig.json
module: "ESNext" and
moduleResolution: "Bundler" instead.
WebAssembly assets
The default Manifold runtime is bundled with InvariantCAD. In a normal Vite or similar production build, the runtime resolves its sibling WASM asset throughimport.meta.url. If an environment rewrites asset URLs, pass the final URL:
wasmUrl
on the first initialization in each page or worker. After a successful
initialization, a later request cannot change the configured URL, including
after an initialization that used the default location. A failed initialization
is not cached: a later call can retry with the same or a corrected URL.
OCCT has a larger separate runtime and additional initialization forms. Follow
the OpenCascade guide for Node, browser, and custom
facade setup.
Package-manager install scripts
InvariantCAD needs no install scripts. Neither the package nor its runtime dependencies (occt-wasm, zod, and comlink through occt-wasm) declare
preinstall, install, postinstall, or prepare scripts, and the Manifold
and stock OCCT WebAssembly runtimes ship prebuilt inside the installed
packages. Installing with npm install --ignore-scripts, or under pnpm’s
default policy of blocking dependency build scripts, is supported: the release
gate installs the packed package with --ignore-scripts before running its
clean-consumer smoke test.
Do not allow install scripts on InvariantCAD’s behalf. If other tooling in your
application, such as a bundler or browser test runner, needs one, follow that
tool’s documentation, scope the exception to that package, and keep the
lockfile reviewed.