Closed davidyang closed 3 years ago
Hi there!
We’re not yet in an place where dependencies can be used in browsers without a build step.
I suggest using esbuild, it’s fast: https://esbuild.github.io. Alternatively, indeed, browserify with a couple of steps.
I wasn't able to make this work in the browser (because normalize-strings uses require).
I was able to browserify it but it was a bit tricky, the command I used is as follows:
browserify index.js -p esmify -s syllable -o syllable-browser.js
That creates a global variable called
syllable
that you can use likesyllable.syllable(word)
. Not the most elegant but just wanted something quick and dirty.