Http in Node and Browserify, simply.


Http in the browser and Node.js with no hassle.

The beauty of this module is that it handles all browserify configurations for which module to load for server or browser.

npm install httpify --save

When using with Browserify, this module returns a shimmed version of the xhr module. When using with Node, it returns the raw request module.

var request = require('httpify')
var req = request({
  url: '',
  method: 'GET',
  type: 'json'
}, function (errresponsebody) {
  // Do stuff 

See the documentation for xhr and request for a complete list of options.

  • add support for Angular
  • add more robust Browserify bundle/transform support