Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bbc/http-transport-circuit-breaker

Package Overview
Dependencies
Maintainers
479
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bbc/http-transport-circuit-breaker

Basic circuit breaker based on Levee.

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
127
decreased by-7.3%
Maintainers
479
Weekly downloads
 
Created
Source

http-transport-circuit-breaker

Basic circuit breaker based on Levee.

Installation

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

Usage

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

FAQs

Package last updated on 11 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc