@tmke8/pikru
v0.1.0
Published
WASM bindings for pikru - renders Pikchr diagrams to SVG
Readme
pikru-node
WASM bindings for pikru, a Rust library that renders Pikchr diagrams to SVG.
Installation
npm install @tmke8/pikruUsage
import { Pikru } from '@tmke8/pikru';
const pikru = new Pikru();
const svg = pikru.render('box "Hello" arrow box "World"');Options
The Pikru constructor accepts an optional options object:
const pikru = new Pikru({ cssVariables: true });| Option | Type | Default | Description |
|--------|------|---------|-------------|
| cssVariables | boolean | false | Use CSS variables for colors, enabling light/dark mode support |
Development
Building
Build the Node.js package:
cd node
npm install
npm run buildBuild for web (requires wasm-pack):
cd pikru-wasm
wasm-pack build --target web --out-dir ../playground/pkgTesting
cd node
npm testPlayground
A simple test page is included in the playground/ directory:
cd playground
python3 -m http.server 8000Then open http://localhost:8000 in your browser.
