First, you must have wasm-pack
installed. Go!
Then simply type:
wasm-pack build
This will generate a pkg
folder that contains the library as a JS module (or whatever its called, IDK, something that can be used as a dependency in JS). Like so,
import { Universe, Cell } from "fraud-game-of-life"; // <<=== WASM
And to publish to NPM is as easy as,
wasm-pack publish
This repository does not look nice, but it does contain the auto generated stuff just for show.