1.0.4 • Published 7 years ago

revolt v1.0.4

Weekly downloads
18
License
MIT
Repository
github
Last release
7 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

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.9.0

9 years ago

0.8.0

9 years ago

0.7.0

9 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago

0.0.0

9 years ago