HenrikJoreteg/ICanHaz.js

Use node-style requires that don't pollute the global namespace

zeke opened this issue · 1 comments

zeke commented

The current implementation of ICanHaz assigns ich to the global namespace (window) automatically. I would rather assign that dependency myself to a local variable, just like in regular node-land. As a browserify user, I expect to write this:

var ich = require('ich');

This convention makes code easier to understand, and there's no mystery about where dependencies are coming from or what's in global scope.

@substack or @thlorenz, what's the best way to make this browserify-friendly?

zeke commented

😊

Um, I just wrote that whole rant and then realized ich actually works as I was suggesting. Oops. On the bright side, I now have a template for the next browserify-unfriendly project I come across.