open-index/open-npm huggingface dataset:
npm package: @bbc/http-transport-circuit-breaker
Description: Basic circuit breaker based on Levee.
Latest version: 1.2.0

# http-transport-circuit-breaker

> Basic circuit breaker based on [Levee](https://github.com/krakenjs/levee).

## Installation

```
npm install --save @bbc/http-transport-circuit-breaker
```

## Usage

```js
const Levee = require('levee');
const request = require('request');

const options = {
    maxFailures: 5,
    timeout: 60000,
    resetTimeout: 30000
};

const circuit = Levee.createBreaker(request.get, options);
circuit.run('http://www.google.com', (err, req, payload) => {
    console.log(err || payload);
});
```

## Test

```
npm test
```

To generate a test coverage report:

```
npm run coverage
```
npm package: @bbc/http-transport-xray
Description: Create X-Ray subsegments and add Tracing Header
Latest version: 1.1.0

# HTTP Transport X-Ray
Create X-Ray subsegments and add Tracing Header

## Installation

```
npm install --save @bbc/http-transport-xray
```

## Usage

Use per call.
Pass in a segment to create a subsegment for that call, identified by the host name.

```js
const HttpTransport = require('@bbc/http-transport');
const AWSXRay = require('aws-xray-sdk');
const xray = require('@bbc/http-transport-xray').middleware;

const segment = new AWSXRay.Segment('mySegment');

const client = HttpTransport.createClient();

client
  .use(xray(segment))
  .get(url)
  .asResponse();
```

## Test

```
npm test
```