New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

axios-cached-dns-resolve

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-cached-dns-resolve - npm Package Compare versions

Comparing version

to
0.3.2

2

__tests__/test.js

@@ -96,4 +96,4 @@ import { serial as test } from 'ava'

t.is(1, axiosCachingDns.config.cache.length)
await delay(1000)
await delay(2000)
t.is(0, axiosCachingDns.config.cache.length)
})

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

var config = exports.config = {
disabled: process.env.AXIOS_DNS_DISABLE === 'true',
dnsTtlMs: process.env.AXIOS_DNS_CACHE_TTL_MS || 5000, // when to refresh actively used dns entries (5 sec)

@@ -115,3 +116,3 @@ cacheGraceExpireMultiplier: process.env.AXIOS_DNS_CACHE_EXPIRE_MULTIPLIER || 2, // maximum grace to use entry beyond TTL

function registerInterceptor(axios) {
if (!axios || !axios.interceptors) return; // supertest
if (config.disabled || !axios || !axios.interceptors) return; // supertest
axios.interceptors.request.use(async function (reqConfig) {

@@ -118,0 +119,0 @@ var url = void 0;

@@ -14,2 +14,3 @@ import dns from 'dns'

export const config = {
disabled: process.env.AXIOS_DNS_DISABLE === 'true',
dnsTtlMs: process.env.AXIOS_DNS_CACHE_TTL_MS || 5000, // when to refresh actively used dns entries (5 sec)

@@ -78,3 +79,3 @@ cacheGraceExpireMultiplier: process.env.AXIOS_DNS_CACHE_EXPIRE_MULTIPLIER || 2, // maximum grace to use entry beyond TTL

export function registerInterceptor(axios) {
if (!axios || !axios.interceptors) return // supertest
if (config.disabled || !axios || !axios.interceptors) return // supertest
axios.interceptors.request.use(async (reqConfig) => {

@@ -81,0 +82,0 @@ let url

{
"name": "axios-cached-dns-resolve",
"version": "0.3.1",
"version": "0.3.2",
"description": "Caches dns resolutions made with async dns.resolve instead of default sync dns.lookup, refreshes in background",

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

@@ -53,2 +53,3 @@ # axios-cached-dns-resolve

const config = {
disabled: process.env.AXIOS_DNS_DISABLE === "true",
dnsTtlMs: process.env.AXIOS_DNS_CACHE_TTL_MS || 5000, // when to refresh actively used dns entries (5 sec)

@@ -55,0 +56,0 @@ cacheGraceExpireMultiplier: process.env.AXIOS_DNS_CACHE_EXPIRE_MULTIPLIER || 2, // maximum grace to use entry beyond TTL