orgize/wasm
PoiScript 00b46a278a
feat: initial wasm support
2021-11-08 16:17:11 +08:00
..
src feat: initial wasm support 2021-11-08 16:17:11 +08:00
tests feat: initial wasm support 2021-11-08 16:17:11 +08:00
.gitignore feat: initial wasm support 2021-11-08 16:17:11 +08:00
README.md feat: initial wasm support 2021-11-08 16:17:11 +08:00
index.html feat: initial wasm support 2021-11-08 16:17:11 +08:00
package.json feat: initial wasm support 2021-11-08 16:17:11 +08:00
rollup.js feat: initial wasm support 2021-11-08 16:17:11 +08:00
tsconfig.json feat: initial wasm support 2021-11-08 16:17:11 +08:00
yarn.lock feat: initial wasm support 2021-11-08 16:17:11 +08:00

README.md

orgize

npm

Quick start

Install the package:

npm install orgize
yarn add orgize

Load the wasm module and init:

Browser

import { init, renderHtml } from "orgize";

init().then(() => {
  console.log(renderHtml("* Hello, /world/!"));
});

Node.js

const { init, renderHtml } = require("orgize");
const { readFile } = require("fs/promises");

readFile(require.resolve("orgize/lib/orgize_bg.wasm"))
  .then((bytes) => init(new WebAssembly.Module(bytes)))
  .then(() => {
    console.log(renderHtml("* Hello, /world/!"));
  });

License

MIT