eliot-akira / pikchr-wasm

A fast and small port of Pikchr to WASM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pikchr WASM

A fast and small port of Pikchr to WASM.

Install

npm install --save pikchr-wasm

Usage

import pikchr from 'pikchr-wasm'; // Default entrypoint, optimized for speed, ~76kb min+gzip
// import pikchr from 'pikchr-wasm/speed'; // Default entrypoint, optimized for speed, ~76kb min+gzip
// import pikchr from 'pikchr-wasm/size'; // Alternative entrypoint, optimized for bundle size, ~65kb min+gzip

await pikchr.loadWASM (); // First of all you need to load the WASM instance and wait for it

const markup = 'box'; // The markup to render
const svg = pikchr.render ( markup ); // You get an SVG as a string back

Licenses

About

A fast and small port of Pikchr to WASM.

License:MIT License


Languages

Language:C 99.0%Language:TypeScript 0.5%Language:JavaScript 0.3%Language:Shell 0.2%