Skip to content

Commit

Permalink
Using promise version of ping
Browse files Browse the repository at this point in the history
More output for debugging
  • Loading branch information
ricardonunesdev committed Sep 14, 2017
1 parent 389d489 commit 8212481
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions domain-ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ const getDomainIp = (domain) => {

const pingIp = (ip) => {
return new Promise((resolve, reject) => {
ping.sys.probe(ip, (alive) => {
return resolve(alive);
});
ping.promise.probe(ip)
.then((res) => {
console.log(res);
return resolve(res.alive);
})
.catch(reject);
});
};

Expand Down

0 comments on commit 8212481

Please sign in to comment.