1.8.4 • Published 1 month ago

supra-http v1.8.4

Weekly downloads
372
License
ISC
Repository
github
Last release
1 month ago

Documentation will be released soon.

CircleCI codecov npm version

Installing

npm i supra-http

Simple Usage

Get

client.request('apiCallName', 'https://my-api/endpoint', {
  method: 'get',
  json: true
})
  .then(response => console.log(response.json))
  .catch(_ => console.log(_));

Post

client.request('apiCallName', 'https://my-api/endpoint', {
  method: 'post',
  body: {
    test: true  
  },
  json: true
})
  .then(response => console.log(response.json))
  .catch(_ => console.log(_));

Circuit Breaking

client.request('apiCallName', 'https://my-api/endpoint', {
  timeout: 1000,
  allowWarmUp: true,
  errorThresholdPercentage: 50,
  resetTimeout: 10000,
  enabled: true,
  method: 'get',
  json: true
})
  .then(response => console.log(response.json))
  .catch(_ => console.log(_));

You can read more about properties from opossum.

Decompression

Supra supports gzip and brotli decompressions over zlib. So it requires at least NodeJs 10.17.x

Benchmarks

supra with circuit x 8,779 ops/sec ±3.31% (76 runs sampled)
supra without circuit x 8,625 ops/sec ±4.68% (68 runs sampled)
requestretry x 3,672 ops/sec ±7.24% (67 runs sampled)
request x 5,092 ops/sec ±4.42% (73 runs sampled)
native http request 1.0 x 9,874 ops/sec ±5.82% (67 runs sampled)
native http request 1.1 x 9,681 ops/sec ±6.36% (73 runs sampled)
1.8.4

1 month ago

1.8.3

1 month ago

1.8.2

4 months ago

1.8.1

2 years ago

1.8.0

2 years ago

1.7.0

3 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago