@rhcp/heading_hash_wasm_web
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

WebAssembly build of the heading_hash transform

This is a WebAssembly build of the heading_hash transform, suitable for use in Nodejs and browsers.

Initial setup

Install wasm-pack.

The wasm-pack site recommends curling into your shell to install, but I prefer using cargo:

cargo install wasm-pack

Once wasm-pack is installed, you can build, test, and publish this package.js

🛠️ Build with

Build for nodejs:

make build_node

Build for web:

make build_web

Default is a release build with optimizations and no debug info. Add --dev for a debug build.

wasm-pack build docs

Using the nodejs package

Add the dependency:

npm i @rhcp/heading_hash_wasm

Import & use it:

import * as headingHash from "@rhcp/heading_hash_wasm";

console.log(headingHash.transform(#hello"));

Using the web package

npm i @rhcp/heading_hash_wasm_web

Import the package, initialize it, and log a transformed string.

import { default as init, transform } from "@rhcp/heading_hash_wasm_web";
await init();
console.log(transform("#hello"))

Please note that this example assumes you have a bundler which will resolve the name @rhcp/heading_hash_wasm_web.

🔬 Test in Headless Browsers with wasm-pack test

wasm-pack test --headless --firefox

wasm-pack test docs

Readme

Keywords

none

Package Sidebar

Install

npm i @rhcp/heading_hash_wasm_web

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

1.02 MB

Total Files

6

Last publish

Collaborators

  • bexter89
  • dfaucette
  • rlahoda
  • cgatyas
  • caramelcode
  • mwcz
  • kylebuch8