I recently worked on an npm package that is supposed to be consumed on both Node.js environment and the browser (using React/Angular/etc..).
Things started getting complicated when the node branch of the code needed to require native Node.js packages — like fs.
#node