DreamDB

Install

bash
npm install @dreamlake/dreamdb@0.5.4

Check what you got:

bash
node -e "import('@dreamlake/dreamdb').then(m => console.log(m.version(), typeof m.Space))"
# 0.5.4 function

Three entry points

The package ships three builds and picks one for you based on how it is imported:

ImportBuildNotes
@dreamlake/dreamdb in a bundlerbundlerVite needs vite-plugin-wasm
@dreamlake/dreamdb in NodenodejsESM and CJS both work. The only build with Authoring
@dreamlake/dreamdb/webwebNo bundler plugin. await ready() before anything else

The /web entry is the one to reach for in a plain page or an import-map setup, because it fetches and instantiates the WebAssembly itself:

html
<script type="module">
  import ready, { Space } from "https://esm.sh/@dreamlake/dreamdb/web";
  await ready();

  const space = await Space.fromUri("https://bucket.example/refs/photos", null);
  console.log(space.tracks().map(t => t.key));
</script>

Runtime requirements

  • Node 20 or newer. Node prints an experimental-feature warning for the WebAssembly import; it is harmless.
  • Any browser with WebAssembly.
  • No other runtime dependencies. The package is the wasm binary, its bindings, and the entry shims.

Bundlers

Vite, Astro, SvelteKit — install vite-plugin-wasm and add it to plugins. Without it the .wasm import fails at build time as an unresolved asset.

Next.js — set experiments.asyncWebAssembly in the webpack config, or keep DreamDB calls on the server, where the Node build is used and no plugin is needed.

Plain <script type="module"> — use the /web entry above; nothing to configure.

Which SDK for which job

This package reads everywhere, and writes wherever you give it a backend that can PUT. It cannot create a dataset in the browser, and it cannot train a spatial index anywhere. For ingestion pipelines, index training, and PyTorch, use the Python SDK. The two write identical bytes.