keithamus / jwerty

⌨ Awesome handling of keyboard events
http://keithamus.github.io/jwerty
Other
1.21k stars 109 forks source link

Difference between source code and archives/npmjs versions #72

Open thfontaine opened 7 years ago

thfontaine commented 7 years ago

Hey ! I encounter an issue with your (great !) library. When i install jwerty using npm, it download me a file with :

(function (global, exports) {
...
}(this, ...));

This doesn't work with my project, because the global isn't set to window But when i'm looking to your source code, i see :

(function (global, exports) {
...
}(typeof global !== 'undefined' && global.window || this, ...));

which works well. Can you explain me why there is a difference between these two (same ?) files ? Thank you in advance =)

keithamus commented 7 years ago

@thfontaine master has some fixes in it which have yet to be published. It is on my todo list to publish this soon. In the meantime you can use the master version by doing the following in your package.json:

"dependencies": {
  "jwerty": "keithamus/jwerty#master",
}
thfontaine commented 7 years ago

Ok, thank you for your answer !