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
var x = require('keypress.js') // from NPM module, it's published as keypress.js instead of keypres
x.keypress // The module
Whats more typical for node modules is like so
var x = 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.
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.