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

retry-request

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retry-request - npm Package Compare versions

Comparing version 1.2.4 to 1.3.0

8

index.js

@@ -8,2 +8,3 @@ 'use strict';

var DEFAULTS = {
objectMode: false,
request: request,

@@ -26,2 +27,5 @@ retries: 2,

if (typeof opts.objectMode === 'undefined') {
opts.objectMode = DEFAULTS.objectMode;
}
if (typeof opts.request === 'undefined') {

@@ -45,3 +49,3 @@ opts.request = DEFAULTS.request;

var retryRequest = {
abort: function() {
abort: function () {
if (activeRequest && activeRequest.abort) {

@@ -54,3 +58,3 @@ activeRequest.abort();

if (streamMode) {
retryStream = through();
retryStream = through({ objectMode: opts.objectMode });
retryStream.abort = resetStreams;

@@ -57,0 +61,0 @@ }

{
"name": "retry-request",
"version": "1.2.4",
"version": "1.3.0",
"description": "Retry a request.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -43,2 +43,10 @@ |![retry-request](logo.png)

#### `opts.objectMode`
Type: `Boolean`
Default: `false`
Set to `true` if your custom `opts.request` function returns a stream in object mode.
#### `opts.retries`

@@ -88,2 +96,4 @@

*NOTE: If you override the request function, and it returns a stream in object mode, be sure to set `opts.objectMode` to `true`.*
```js

@@ -90,0 +100,0 @@ var originalRequest = require('request').defaults({

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