piranha/keymage

Publish to NPM

jeffchan opened this issue · 12 comments

It would be great if keymage was published to NPM so Browserify can easily fetch the files.

Makes sense. I'll try to get to that soon.

Done! Please check if everything's ok for you. :)

Does not work, since you did not export anything. If you can't get this done, drop me a line, so I can assist

Hah, that's funny, sorry. Should be ok now.

Wow, that was fast... works like a charm 👍 Was in the process of switching to keymaster... but now I'm back.

Cool, thanks for feedback, and making me feel that my work is not useless! Hope it'll serve you well, but if anything - don't hesitate to open an issue. :) Or send a pull request FWIW. ;)

As far as I can say from currently having one key binding in my App, your module works great 👯

Keeping calm when called in node-env would be nice to have. Currently I have to shim this out in my isomorphic application

global.window = {
  addEventListener: function(){}
};
global.navigator = {
  userAgent: ''
};

I've made to ignore navigator, but then I'm really not sure what to do with window. Probably just ignoring it is fine... Maybe I should issue a warning or something?

I just wonder if that will make someone's life harder by not reporting this error properly.

maybe I handle this myself. But just in case you want to handle this too, this will do the trick:

if (typeof window !== 'undefined') {
  window.addEventListener('keydown', dispatch, false);
}

Yeah, that's understandable (I handled navigator this way), but it's just I'm worried it'll prevent someone from discovering what is the problem. So I think it's better for your app to just explicitly handle this problem, than for keymage to silently not work in an environment which is not suitable.

yeah sounds reasonable!