diff --git a/bindings/wasm/README.md b/bindings/wasm/README.md new file mode 100644 index 000000000..7703ab4a8 --- /dev/null +++ b/bindings/wasm/README.md @@ -0,0 +1,9 @@ +# Limbo Wasm bindings + +This source tree contains Limbo Wasm bindings. + +## Building + +``` +./scripts/build +``` diff --git a/bindings/wasm/examples/example.js b/bindings/wasm/examples/example.js index 30c2dadf7..0ebee33a7 100644 --- a/bindings/wasm/examples/example.js +++ b/bindings/wasm/examples/example.js @@ -2,4 +2,4 @@ import { Database } from 'limbo-wasm'; const db = new Database('hello.db'); -db.exec("SELECT 'hello, world' AS message"); +console.log(db.exec("SELECT 'hello, world' AS message")); diff --git a/bindings/wasm/package.json b/bindings/wasm/package.json new file mode 100644 index 000000000..e8ae29896 --- /dev/null +++ b/bindings/wasm/package.json @@ -0,0 +1,20 @@ +{ + "name": "limbo-wasm", + "collaborators": [ + "the Limbo authors" + ], + "version": "0.0.4", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/penberg/limbo" + }, + "files": [ + "snippets", + "limbo_wasm_bg.wasm", + "limbo_wasm.js", + "limbo_wasm.d.ts" + ], + "main": "limbo_wasm.js", + "types": "limbo_wasm.d.ts" +} diff --git a/bindings/wasm/scripts/build b/bindings/wasm/scripts/build new file mode 100755 index 000000000..23f2b8b93 --- /dev/null +++ b/bindings/wasm/scripts/build @@ -0,0 +1,4 @@ +#!/bin/bash + +wasm-pack build --no-pack --target nodejs +cp package.json pkg/package.json