1.0.4 • Published 8 years ago

revolt v1.0.4

Weekly downloads
18
License
MIT
Repository
github
Last release
8 years ago

revolt

A reactive, pipelined HTTP client.

  • Add common request/response pipeline handlers.
  • Use reactive programming to consume responses.

Install

npm install revolt

Example

var revolt = require('../revolt');

var client = revolt()
  .use(function(handle) {
    handle('request', function(pipeline) {
      return pipeline.map(function(env) {
        var auth = new Buffer('user:password').toString('base64');
        env.request.headers['authorization'] = 'Basic ' + auth;

        return env;
      });
    });
  });

client
  .get('http://localhost:8082')
  .flatMap(function(env) {
    return revolt.buffer(env.response)
      .map(function(data) {
        env.response.body = data.toString();
        return env;
      });
  })
  .subscribe(function(env) {
    console.log(env.response.body);
  });
1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.9.0

10 years ago

0.8.0

10 years ago

0.7.0

10 years ago

0.6.0

10 years ago

0.5.0

11 years ago

0.4.0

11 years ago

0.3.0

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago

0.0.0

11 years ago