I have a library that I want to use in both client side and server side. However, because request is not compatible with browserify, when compiling using browserify
request
I found the answer:
if (typeof window === 'undefined') { var request = require('request'); } else { var request = require('browser-request'); }
Superagent is also looking like a very good alternative!