Skip to content

node-then/dns-then

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dns Then

Build Status

Thin wrapper arround Node's dns module that makes the async functions promise aware. The wrapped methods return a promise the represents the value of the async operation. Traditional callbacks still work, allowing for a transparent drop-in for dns. Sync methods, classes and other helpers are not modified.

Example

Traditional Async

var dns = require('dns-then');
dns.lookup('cujojs.com', function (err, address) {
   ...
});

With Promises

var dns = require('dns-then');
dns.lookup('cujojs.com').then(...);

Wrapped methods

  • lookup
  • resolve
  • resolve4
  • resolve6
  • resolveMx
  • resolveTxt
  • resolveSrv
  • resolveNs
  • resolveCname
  • reverse

About

Promise aware wrapper for Node's dns module

Resources

License

Stars

Watchers

Forks

Packages

No packages published