Examples

Runnable examples, from a one-file quickstart to a full desktop app.

The repository ships several runnable examples. Each is self-contained and demonstrates a different slice of @drasi/lib.

Single-file scripts

These live in examples/ and run with node after you build the addon (npm run build):

ScriptShows
quickstart.mjsLoad a cdylib source plugin, run a continuous query, read results.
js-source.mjsDrive a query from a JavaScript source with pushChange.
js-reaction.mjsHandle result diffs with a JavaScript reaction.

Run one like this:

git clone https://github.com/drasi-project/drasi-nodejs.git
cd drasi-nodejs
npm install
npm run build
node examples/js-source.mjs

End-to-end apps

ExampleShows
Trading demoA full Electron + React desktop app: real PostgreSQL CDC, an in-process JS price feed, synthetic joins, live aggregations, and OCI plugins pulled at runtime.
Electron explorerBrowse and install plugins, then build and observe a topology on the embedded engine.

Start with the Trading demo tutorial for a guided walkthrough of a realistic change-driven application.


Tutorial: Trading Demo

An end-to-end change-driven app: live prices joined against a PostgreSQL database.