@lbug/lbug-wasm
v0.13.1
Published
Ladybug GraphDB powered by WebAssembly
Maintainers
Readme
Ladybug is an embedded graph database built for query speed and scalability.
Ladybug-Wasm brings Ladybug to every browser thanks to WebAssembly.
Try it out at Ladybug-shell.netlify.app.
Installation
Prerequisite: Enable Cross-Origin-isolation
CDN
<script type="module">
import Ladybug_wasm from 'https://unpkg.com/@Ladybug/Ladybug-wasm@latest/dist/Ladybug-browser.js';
(async () => {
const Ladybug = await Ladybug_wasm();
window.Ladybug = Ladybug
const db = await Ladybug.Database()
const conn = await Ladybug.Connection(db)
await conn.execute(`CREATE NODE TABLE User(name STRING, age INT64, PRIMARY KEY (name))`)
await conn.execute(`CREATE (u:User {name: 'Alice', age: 35});`)
const res = await conn.execute(`MATCH (a:User) RETURN a.*;`)
const res_json = JSON.parse(res.table.toString());
})();
</script>Webpack/React/Vue
npm install @lbug/Ladybug-wasmimport Ladybug_wasm from '@lbug/Ladybug-wasm';
(async () => {
const Ladybug = await Ladybug_wasm();
const db = await Ladybug.Database()
const conn = await Ladybug.Connection(db)
await conn.execute(`CREATE NODE TABLE User(name STRING, age INT64, PRIMARY KEY (name))`)
await conn.execute(`CREATE (u:User {name: 'Alice', age: 35});`)
const res = await conn.execute(`MATCH (a:User) RETURN a.*;`)
const res_json = JSON.parse(res.table.toString());
})();Build from source
git clone https://github.com/LadybugDB/Ladybug-wasm.git --recursive
make packageRepository Structure
| Subproject | Description | Language | | -------------------------------------------------------- | :------------- | :--------- | | Ladybug_wasm | Wasm Library | C++ | | @Ladybug/Ladybug-wasm | Javascript API | Javascript | | @Ladybug/Ladybug-shell | Cypher Shell | React |
License
By contributing to Ladybug-wasm, you agree that your contributions will be licensed under the MIT License.
