{"bugs":{"url":"http://github.com/tjfontaine/native-dns-cache/issues"},"dist":{"shasum":"ce0998f7fdf6c7990970a33190624b0e98ee959b","tarball":"https://registry.npmjs.org/native-dns-cache/-/native-dns-cache-0.0.2.tgz","integrity":"sha512-09HXHdb/updxfigaFbR53F8nCKqxM8WuHfTWBsusVlwSSZZ3qwWRdD6Kx2x8HBI1Q5IaycwcJOvBoXZWJNfVEg==","signatures":[{"sig":"MEYCIQC29pz5iZsXt67a9OusXK/q46lbdSx3hXJ72zBSAUKKPwIhAOONIs8g10a1HSseZSmnQLzqZKyYTNw5nCPaZPRll4kS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","name":"native-dns-cache","_from":".","author":{"url":"http://atxconsulting.com","name":"Timothy J Fontaine","email":"tjfontaine@gmail.com"},"readme":"Cache\n-----\n\nIf you perform a query on an A or AAAA type and it doesn't exist, the cache\nwill attempt to lookup a CNAME and then resolve that.\n\nThe constructor takes an optional object with the following properties:\n\n * `store` -- implements the cache store model (optional, default MemoryStore)\n\nMethods:\n\n * `lookup(question, cb)` -- for a given question check the cache store for\nexistence\n * `store(packet)` -- iterates over the resource records in a packet and sends\nthem to the cache store\n * `purge()` -- clears the cache store of all entries\n\nMemoryStore / Cache store model\n-------------------------------\n\n`MemoryStore(opts)` -- An in memory store based on a js object\n\nMethods:\n\n * `get(domain, key, cb)`\n  - `domain` is the holder under which keys will be applied,\n`key` is the subdomain that is being queried for.\nIf you `get('example.com', 'www', cb)` you are really asking for `www.example.com`.\n  - `cb(err, results)` -- results is an object of types and array of answers\n   * `{ 1: [{address: '127.0.0.1', ttl: 300, type: 1, class: 1}] }`\n * `set(domain, key, data, cb)`\n  - `domain` is the parent under which this key is stored.\n`key` is the subdomain we are storing, `data` is an object of types with an array of answers.\n   * `set('example.com', 'www', {1: [{class:1, type:1, ttl:300, address:'127.0.0.1'}]}, cb)`\n  - `cb(err, data)` -- cb merely returns the data that was passed.\n * `delete(domain[, key[, type]], cb)` -- delete all from a domain, a domain and key,\nor a domain a key and a type.\n\nLookup\n------\n\nIs a mechanism that given a store performs the common resolution pattern.\n\nGiven `example.com` previous added to a store:\n\n  * `www.example.com CNAME foo.bar.example.com.`\n  * `*.example.com A 127.0.0.1`\n\nA `Lookup(store, 'example.com', {name:'www.example.com', type:1}, cb)`\nwill resolve `www` to the CNAME and then search for `foo.bar.example.com` which\nwill return no results, and then search for `*.bar.example.com` which will also\nreturn no results, and ultimately searches for `*.example.com` which will return\nthe desired record.\n\nCallback will be called with `(err, results)` where results is an array suitable\nfor use in `Packet.answer`\n","engines":{"node":">= 0.5.0"},"scripts":{},"_npmUser":{"name":"tjfontaine","email":"tjfontaine@gmail.com"},"homepage":"http://github.com/tjfontaine/native-dns-cache","keywords":["dns","caching"],"repository":{"url":"http://github.com/tjfontaine/native-dns-cache.git","type":"git"},"_npmVersion":"1.2.14","description":"DNS Caching Library","maintainers":[{"name":"tjfontaine","email":"tjfontaine@gmail.com"}],"dependencies":{"binaryheap":">= 0.0.3","native-dns-packet":">= 0.0.1"},"readmeFilename":"README.md","devDependencies":{},"_id":"native-dns-cache@0.0.2","version":"0.0.2"}