Socket
Socket
Sign inDemoInstall

cacheable-lookup

Package Overview
Dependencies
2
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.2.0

index.d.ts

1

index.js

@@ -176,1 +176,2 @@ 'use strict';

module.exports = CacheableLookup;
module.exports.default = CacheableLookup;

11

package.json
{
"name": "cacheable-lookup",
"version": "0.1.0",
"version": "0.2.0",
"description": "A cacheable dns.lookup(…) that respects the TTL",
"files": ["index.js"],
"files": [
"index.js",
"index.d.ts"
],
"main": "index.js",
"scripts": {
"test": "xo && nyc ava"
"test": "xo && nyc ava && tsd"
},

@@ -27,2 +30,3 @@ "repository": {

"devDependencies": {
"@types/keyv": "^3.1.0",
"ava": "^1.0.1",

@@ -34,2 +38,3 @@ "benchmark": "^2.1.4",

"proxyquire": "^2.1.0",
"tsd": "^0.7.1",
"xo": "^0.23.0"

@@ -36,0 +41,0 @@ },

@@ -82,3 +82,3 @@ # cacheable-lookup

DNS servers used to make the query. Can be overriden - then the new servers will be used.
DNS servers used to make the query. Can be overridden - then the new servers will be used.

@@ -152,4 +152,8 @@ #### [lookup(hostname, options, callback)](https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback)

The package is based on [`dns.resolve4(…)`](https://nodejs.org/api/dns.html#dns_dns_resolve4_hostname_options_callback) and [`dns.resolve6(…)`](https://nodejs.org/api/dns.html#dns_dns_resolve6_hostname_options_callback), because `dns.lookup(…)` doesn't have the `ttl` option.
The package is based on [`dns.resolve4(…)`](https://nodejs.org/api/dns.html#dns_dns_resolve4_hostname_options_callback) and [`dns.resolve6(…)`](https://nodejs.org/api/dns.html#dns_dns_resolve6_hostname_options_callback).
[Why not `dns.lookup(…)`?](https://github.com/nodejs/node/issues/25560#issuecomment-455596215)
> It is not possible to use `dns.lookup(…)` because underlying calls like [getaddrinfo](http://man7.org/linux/man-pages/man3/getaddrinfo.3.html) have no concept of servers or TTL (caching is done on OS level instead).
## Related

@@ -156,0 +160,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc