Rebecca Peltz wrote:Is there a pattern to create an NPM library using Node.js that can be imported with and used in vanilla JavaScript?
Hello Rebecca,
I am not sure i would call it "a pattern" but in general, if you don't use functionality that is available only in the Node.js standard library, you can easily publish npm modules that work both on browsers and Node.js.
I have done something similar in the past, so if you need an example you can check out this one:
https://github.com/lmammino/financial
I hope this answers your question.