appolo-dns-cache

0.0.5 • Public • Published

DNS Cache

This module wraps the dns and caches all dns lookups using appolo-cache

Installation

npm install appolo-cache

Usage

wrap dns methods

import dns = require('dns');
import {dnsCache} from "appolo-dns-cache";

dnsCache({override: true, ttl: 1000, maxItems: 10000});
  
    //will call the wrapped dns
    dns.lookup('www.yahoo.com', function(err, result) {
        //do something with result
    });

use dnsCache

import {dnsCache} from "appolo-dns-cache";

let dns = dnsCache({override: false, ttl: 1000, maxItems: 10000});

 //will call the wrapped dns
    dns.lookup('www.google.com', function(err, result) {
        //do something with result
    });

Readme

Keywords

Package Sidebar

Install

npm i appolo-dns-cache

Weekly Downloads

117

Version

0.0.5

License

MIT

Unpacked Size

13.5 kB

Total Files

11

Last publish

Collaborators

  • shmoop207