You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know the module works with require, but do you have any thoughts on supporting node style require over just commonjs?
Currently, works like so
varx=require('keypress.js')// from NPM module, it's published as keypress.js instead of keypresx.keypress// The module
Whats more typical for node modules is like so
varx=require('keypress.js');x;// The module
In my experience just from browsing through other projects, it seems that people give prevalence to module.exports if it's available, and fall back to just exports when thats available. If that's a palatable solution, I'd be happy to submit a PR. This is hardly a breaking thing either way, just a nice convenience bit.
Alternatively, I could convert it to UMD.
Either way, it's a breaking change by default (since anybody in a node environment would be expecting requiredvar.keypress, not just requiredvar. We could also shortcut that though, so it would continue working.
The text was updated successfully, but these errors were encountered:
Sorry for the super late response. If you'd like to submit a PR that would be great. It sounds like you know more about this particular case than I do.
I know the module works with require, but do you have any thoughts on supporting node style require over just commonjs?
Currently, works like so
Whats more typical for node modules is like so
In my experience just from browsing through other projects, it seems that people give prevalence to module.exports if it's available, and fall back to just exports when thats available. If that's a palatable solution, I'd be happy to submit a PR. This is hardly a breaking thing either way, just a nice convenience bit.
Alternatively, I could convert it to UMD.
Either way, it's a breaking change by default (since anybody in a node environment would be expecting requiredvar.keypress, not just requiredvar. We could also shortcut that though, so it would continue working.
The text was updated successfully, but these errors were encountered: