0.2.0 • Published 5 years ago

dvi2html-wasm v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

A dvi2html converter written in Rust and ported to WebAssembly using wasm-pack.

npm version

About

  • NPM package to convert dvi files (as Uint8Array) to html
  • It uses the dvi2html rust package (see crate folder)
  • Install with npm i dvi2html-wasm or yarn add dvi2html-wasm

Example

import {dvi2html} from "dvi2html-wasm";

fetch('http://localhost:8080/main.dvi')
  .then(res => res.blob())
  .then(b => b.arrayBuffer())
  .then(b => {
    console.log(b);
    console.time("Generating html");
    let result = dvi2html(new Uint8Array(b))
    console.timeEnd("Generating html");
    console.time("Adding to body");
    let child = document.createElement('div');
    child.innerHTML= result;
    document.body.appendChild(child);
    console.timeEnd("Adding to body");
  });

Development

Commands

Build with wasm-pack build

wasm-pack build

Test in Headless Browsers with wasm-pack test

wasm-pack test --headless --firefox

Publish to NPM with wasm-pack publish

wasm-pack publish

Info

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago