https://github.com/fed135/ha-dns-cache
A DNS cache using ha-store
https://github.com/fed135/ha-dns-cache
dataloader dns-cache hacktoberfest nodejs
Last synced: 6 months ago
JSON representation
A DNS cache using ha-store
- Host: GitHub
- URL: https://github.com/fed135/ha-dns-cache
- Owner: fed135
- License: other
- Created: 2019-05-15T19:51:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-12-20T21:39:07.000Z (about 4 years ago)
- Last Synced: 2025-07-05T22:15:27.894Z (6 months ago)
- Topics: dataloader, dns-cache, hacktoberfest, nodejs
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ha-dns-cache
A DNS cache using [ha-store](https://github.com/fed135/ha-store)!
- Smart TLRU cache
- Request coalescing and batching
- Insightful stats and [events](https://github.com/fed135/ha-store#Monitoring-and-events)
- Lightweight, configurable, battle-tested
## Installing
`npm install ha-dns-cache`
## Usage
```node
const DNSCache = require('ha-dns-cache')({ ttl: 30000, limit: 500 });
DNSCache.on('cacheHit', evt => console.log('cache-hit!', evt));
```
## Testing
You can benchmark this library by running:
```
npm run bench
```
And compare with regular results:
```
npm run bench:no-cache
```
## Contribute
Please do! This is an open source project - if you see something that you want, [open an issue](https://github.com/fed135/ha-dns-cache/issues/new) or file a pull request.
I am always looking for more maintainers, as well.
## License
[Apache 2.0](LICENSE) (c) 2021 Frederic Charette