cacheable-lookup
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -176,1 +176,2 @@ 'use strict'; | ||
module.exports = CacheableLookup; | ||
module.exports.default = CacheableLookup; |
{ | ||
"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 @@ |
15217
5
234
164
9