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

@everymundo/promise-data-to

Package Overview
Dependencies
Maintainers
34
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@everymundo/promise-data-to - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

17

lib/promise-data-to.js

@@ -12,4 +12,4 @@ 'use strict'

const MAX_RETRY_ATTEMPTS = Math.abs(process.env.MAX_RETRY_ATTEMPTS) || 3
const RETRY_TIMEOUT_MS = Math.abs(process.env.RETRY_TIMEOUT_MS) || 500
const REQUEST_TIMEOUT_MS = Math.abs(process.env.RETRY_TIMEOUT_MS) || 10000
const RETRY_TIMEOUT_MS = process.env.RETRY_TIMEOUT_MS && Math.abs(process.env.RETRY_TIMEOUT_MS)
const REQUEST_TIMEOUT_MS = process.env.REQUEST_TIMEOUT_MS && Math.abs(process.env.REQUEST_TIMEOUT_MS)

@@ -44,4 +44,3 @@ const promiseDataTo = ({

headers,
agent,
timeout
agent
}

@@ -132,2 +131,12 @@

if (['PUT', 'PATCH', 'POST'].includes(method.toUpperCase())) request.write(data)
if (timeout != null) {
request.on('socket', (socket) => {
socket.on('timeout', () => {
request.abort()
})
socket.setTimeout(timeout)
})
}
request.end()

@@ -134,0 +143,0 @@ }

{
"name": "@everymundo/promise-data-to",
"version": "1.4.1",
"version": "1.4.2",
"description": "This is a helper to perform POST requests using promises and no external dependencies",

@@ -10,7 +10,7 @@ "main": "index.js",

"scripts": {
"cover": "env RETRY_TIMEOUT_MS= MAX_RETRY_ATTEMPTS= SIMULATE= LOG_LEVEL=trace nyc -x test --reporter=lcov --reporter=text mocha test --recursive",
"cover": "env RETRY_TIMEOUT_MS= MAX_RETRY_ATTEMPTS= REQUEST_TIMEOUT_MS= SIMULATE= LOG_LEVEL=trace nyc -x test --reporter=lcov --reporter=text mocha test --recursive",
"check-coverage": "nyc check-coverage --statements 100 --branches 100 --functions 100 --lines 100",
"check-lint": "standard --env=mocha *.js lib/*.js test/*.js test/lib/*.js",
"fix-lint": "standard --env=mocha --fix *.js lib/*.js test/*.js",
"test": "env RETRY_TIMEOUT_MS= MAX_RETRY_ATTEMPTS= SIMULATE= mocha"
"test": "env RETRY_TIMEOUT_MS= MAX_RETRY_ATTEMPTS= REQUEST_TIMEOUT_MS= SIMULATE= mocha"
},

@@ -17,0 +17,0 @@ "config": {

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