API · OVERVIEW

API reference

Two layers. The C++ classes are gdal3.js's high-level wrappers over GDAL (Gdal, Dataset, Driver, …), bound straight from their headers. cpp.js is the toolchain underneath: the factory that boots the wasm, the runtime helpers, the build config, and the headers-as-modules mechanism. Names are camelCase; under useWorker every call returns a promise.

OPTIONS ARE GDAL'S Every operation takes a string vector of plain GDAL CLI flags (Module.toVector("VectorString", ["-f", "GPKG"])), parsed by GDAL's own option parsers. The reference for the flags is the upstream GDAL programs documentation; this reference covers the JavaScript surface that wraps them.

C++ classes

gdal3.js's high-level C++ wrappers over GDAL, exposed to JavaScript.

cpp.js

The toolchain that compiles GDAL to wasm and runs it. Generic to every cpp.js package, not gdal3.js-specific.

TypeScript

The generated .h-module bridges ship without .d.ts files, so TypeScript projects import them with // @ts-ignore and type their own thin wrappers around the calls they use. The bundled converter apps do exactly this; their types.ts files are a good starting point to copy. First-class typings are planned.

GDAL version & drivers

at runtime
await Gdal.versionInfo("RELEASE_NAME");   // "3.13.1"
await Gdal.getDriverCount();              // 100+, CI-asserted