Hacker News new | ask | show | jobs
by pluma 4250 days ago
If you use browserify for your "isomorphic" code (i.e. JS that runs on client and server), you may have situations in which you need to run different code depending on whether the code executes on the client and server (think XMLHttpRequest vs `require('http')`).

In node you do that by extracting the code in a separate module and telling browserify to use the browser-specific module via your package.json.

In Meteor you can just check whether you're running in the client or server at runtime and execute different code accordingly. That's what `Meteor.isClient` is for.