cacheable-lookup

A cacheable dns.lookup(…) that respects TTL

MIT License

Downloads
52.2M
Stars
179
Committers
11

Bot releases are visible (Hide)

cacheable-lookup - Latest Release

Published by sindresorhus about 2 years ago

Breaking

  • Require Node.js 14 (#69) 08a6478
  • This package is now pure ESM. Please read this.

Improvements

  • Add stats for query and cache requests (#65) ab8d286

https://github.com/szmarczak/cacheable-lookup/compare/v6.1.0...v7.0.0

cacheable-lookup -

Published by szmarczak about 2 years ago

  • Add entry source, either cache or query (#63) 185a8a4d06f3b663aa69cbe2d297d5758f91cd81 @monkbroc
cacheable-lookup - v6.0.4

Published by szmarczak about 3 years ago

  • Handle ENOENT Windows lookup failures (#50) @pimterry
cacheable-lookup -

Published by szmarczak about 3 years ago

  • Fix a regression introduced in #43 (see #48)
cacheable-lookup -

Published by szmarczak about 3 years ago

  • Fallback to dns.lookup for IPv4 & IPv6 separately (#43) fdf95326cd41383053c9abcd12e4dc8a72f0f53d
cacheable-lookup -

Published by szmarczak about 3 years ago

  • Fix typings 06fd8fca0c7b9067c18d52e8e7d82fcec96b0744
cacheable-lookup -

Published by szmarczak over 3 years ago

  • Fix #36 (Allow fallbackDuration = 0 without disabling fallback) 41f6229cc09c298b3588d9b5fc81b54b1dfac0d6
cacheable-lookup -

Published by szmarczak almost 4 years ago

  • Fix promise not being removed from queue on fallback query (#34) da10b58475ab89e944ec112f521e86402c344fc1
  • Update Node.js dependency version (#33) dffb612a622710a330e792827bc219c65940d2bd
cacheable-lookup -

Published by szmarczak over 4 years ago

  • Do not dns.lookup() in background to prevent memory leaks ae7c02ff7dae76e06cce607a02ad98b5afc60691
cacheable-lookup -

Published by szmarczak over 4 years ago

  • Wait for lookup if no entries received from the server 8abe3158a0cd0c85816b4a1f163e496f1fce2869
cacheable-lookup -

Published by szmarczak over 4 years ago

Forgot to update the TypeScript typings (yet again)

cacheable-lookup -

Published by szmarczak over 4 years ago

  • Rewrite main logic (#31) 6f799a8db42778b0b811f6130dd4fec4b7c63671
    • Dropped HostsResolver in favor of the new DNS resolution system.
      From now on, it will use dns.lookup(...) for hostnames that only exist on the OS-side.
      You can modify the duration via the fallbackDuration option. By default it's set to 3600 (1 hour).
    • Added support for Map-compatible instances.
      For example, you can pass an instance of QuickLRU as the cache option.
    • Updating cacheable.servers no longer triggers cacheable.updateInterfaceInfo().
      Instead, it clears the cache directly.
    • Removed cacheable.tick() in favor of the new mechanism to remove outdated entries.
      It's just an unreffed Timeout.
    • Calling cacheable.updateInterfaceInfo() will now only clear the cache on interface removal.
      For example, when your IPv4 interface has disconnected.
    • Up to +400k op/s performance increase when compared to previous version of cacheable-lookup.
    • Fixed docs (finally!).
cacheable-lookup -

Published by szmarczak over 4 years ago

Changelog

Hosts Resolver

  • Fix whitespace normalization (#26) 17d03fdf670f6d64367b8ed8f5bf19efa053c56c
  • Test CRLF style 615412c07516447babf075a2f960c6ca770f82b4
  • Only one HostsResolver per hosts file (#28) 93a20254799b5b1316934c119302a047cb43ff33
  • Fix hanging HostsResolver promises dad5d73b857d9dc544476883b26b6f43cc8fefff
  • Document options.watchingHostsFile e9125439e9be2bd6bf9b510fbe0ffb04c503d031
    Note: it defaults to false, so the hosts file is not being watched by default.

Cacheable Lookup

  • Fix inconsistencies with the Node.js API b2348d5aede36bdf625eba2aa17ca4dedb74c62b
  • Optimize ticks 44ca84e73019d75350e1d4376539ba341a7784de

🎉

Thanks goes to: @cesarfd @dylang @fluffynuts @hoilc and @kaatt for the discovery of new bugs! 🎉

cacheable-lookup -

Published by szmarczak over 4 years ago

  • Fix incorrect example in documentation (#20) 6c5f5d5eed568240ac5b6febe913d5befd8bf5f3
  • Fix incompatibility with Electron renderer process (#22) 4b2cf8f5e4cd22ed4781816605eb298dc59e5f78
cacheable-lookup -

Published by szmarczak over 4 years ago

  • Revert back to fs.watchFile(...) + options.persistent = false e0a2e95e29adc9cee6d1155a9629cb50efebf19f
cacheable-lookup -

Published by szmarczak over 4 years ago

  • Workaround for unreffed fs.watchFile(...) 68d8b77608f9304a3138302364de3b30aa806b07
cacheable-lookup -

Published by szmarczak over 4 years ago

  • Accept Windows installations on other drives than C: (#14) 21617450a80722ada06235d6544609c91b7e5387
  • Add a fallback to dns.lookup(...) (#15) dfefae26f67b5d78be6aaace795b3cb8fccf27d4
    • Improve TS types
    • Improve TS tests
    • Improve Node.js compatibility
  • Prevent overloading DNS servers a40009aa73075b2fa93f224bb654f6c37dd10904
  • Performance improvements (up to +500k op/s)
cacheable-lookup -

Published by szmarczak over 4 years ago

  • Forgot to remove import Keyv from the definitions file afb85ab6e66576745864b9e5d715987f51ea406c
cacheable-lookup -

Published by szmarczak over 4 years ago

  • Rebase the Hosts resolver 7b6c4f5da2fffc430896f38cbe0b8ace49581bae
  • Update benchmarks 0ec2e7da7d46cf978244f69eda61ebe3cb62c3ff

Due to the new Hosts resolver the performance dropped by 2x (4M op/s -> 2M op/s).

cacheable-lookup -

Published by szmarczak over 4 years ago

  • Revert back custom cache support 331235ad8737551be84201f116df8779dec6c846
Package Rankings
Top 1.52% on Npmjs.org
Top 25.92% on Repo1.maven.org
Badges
Extracted from project README
Node CI codecov npm install size