A Javascript package written in Rust leveraging WASM

Josh Finnie

What is WASM-Frontmatter?

  • It's a javascript package to "replace" gray-matter
  • It's API is completely Web Assembly
  • It's currently about twice as fast as gray-matter
  • It's almost at API parity (still working on callbacks)

[1] Gray Matter:
[2] WASM Frontmatter:

What is WASM?

  • WebAssembly (WASM) is an open web standard that defines a portable binary-code format for executable programs in the web giving near-native code execution speed in the web browser. [1]


Tools WASM-Frontmatter Uses

Below are the two tools I use to build WASM-Frontmatter:

  • Rust, of course
  • WASM-Pack


  • All logic for WASM-Frontmatter is written using Rust.
  • It uses the wasm-bindgen[1] crate heavily to build connections between the Rust code and Javascript.



  • A tool seeks to be a one-stop shop for building and working with rust- generated WebAssembly that you would like to interop with JavaScript, in the browser or with Node.js [1]
  • This command line tool is tightly coupled to the wasm-bindgen package we use to code our application in rust
  • It also very nicely helps build and publish your application to NPM


WASM-Pack (Con't)

  • Have Rust installed.
  • Install WASM-pack through this script:                              


  • Once installed, run the following commands to get your package up and running:
$ wasm-pack new hello-world
$ cd hello-world
$ wasm-pack build
$ wasm-pack publish
$ curl -sSf | sh

Live Code!

Thank you!

Josh Finnie

@joshfinnie (almost everywhere)

Building WASM-Frontend

By Josh Finnie

Building WASM-Frontend

  • 1,003