Converts Arrow arrays to SpatioTemporal Asset Catalog (STAC) items, via WebAssembly (WASM).
Warning
This package is in an "alpha" state and will likely break and change a lot.
npm i stac-wasmWe give you two functions:
import * as stac_wasm from "stac-wasm";
const table = loadArrowTable(); // e.g. from DuckDB
const items = stac_wasm.arrowToStacJson(table);
const bytes = stac_wasm.stacJsonToParquet(items);We have some simple automated tests:
yarn install
yarn testIf you want to play with the function, modify www/index.js and then:
cd www
yarn startThis should open a page at http://localhost:8080/ that you can use to test out the WASM library.
stac-wasm is part of rustac, a monorepo that includes the Rust code used to build the WASM module. See CONTRIBUTING.md for instructions on contributing to the monorepo. If your on MacOS, you might have to use llvm as described in this comment.
wasm-pack build
wasm-pack login
cd pkg
npm publish