superagent-hosts

0.3.0 • Public • Published

superagent-hosts

extra hosts file for nodejs superagent requests

Build Status

Example

./hosts

192.168.10.12 foobar.com

./app.js

var request = require('superagent');
var hosts = require('superagent-hosts');
var config = require('fs').readFileSync('./hosts').toString();
request
  .get('http://foobar.com/path/to')
  .use(hosts(config))
  .end(function (err, res) {
    // ...
  });

License

the MIT License

Dependents (0)

Package Sidebar

Install

npm i superagent-hosts

Weekly Downloads

3

Version

0.3.0

License

MIT

Last publish

Collaborators

  • yelo