When I include Figlet.js to the front-end using browserify, the whole thing stops working because of the fs module.
I tried to avoid calling methods that use fs mainly by preloading the fonts using preloadFonts method.
However, when using text or textSync methods the loadFontSync method gets triggered in node.js mode which does not check for already loaded fonts as in the case of browser mode
I created a stop-gap package that solves the problem initially,
https://github.com/websemantics/figlet-browserify but it would be nice to make necessary changes to the library to make it work in the browser regardless of the package manager,
When I include Figlet.js to the front-end using browserify, the whole thing stops working because of the
fs
module.I tried to avoid calling methods that use
fs
mainly by preloading the fonts usingpreloadFonts
method.However, when using
text
ortextSync
methods theloadFontSync
method gets triggered in node.js mode which does not check for already loaded fonts as in the case of browser modeI created a stop-gap package that solves the problem initially, https://github.com/websemantics/figlet-browserify but it would be nice to make necessary changes to the library to make it work in the browser regardless of the package manager,