Skip to content

fabiospampinato/pikchr-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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