I’ve created a node module that is essentially just some useful JS that can also be used client side. I know that require.js can load common.js components, but I don’t necessarily want to make a mandate that everyone who uses my module client side also needs require or common.js or something. I also don’t want to force them to remove the module.exports = ... at the bottom of the file. How do others solve this problem? Do you just create 2 versions, or 2 “compiled” versions rather? Does module.exports work everywhere?
I’ve created a node module that is essentially just some useful JS that can
Share
This is what underscore.js does: