npm i check-rkn
const rkn = require('check-rkn');
// Check list IPs
rkn(['216.58.214.110', '108.174.10.10'], (err, res) => {
console.log(res)
});
// [ { ip: '216.58.214.110', block: false },
// { ip: '108.174.10.10', block: true } ]
// Check one IP
rkn('108.174.10.10', (err, res) => {
console.log(res)
});
// true
// Check list domains
rkn(['google.com', 'linkedin.com'], (err, res) => {
console.log(res)
});
// [ { ip: 'google.com', block: false, ips: [ { ip: '216.58.214.110', block: false } ] },
// { ip: 'linkedin.com', block: true, ips: [ { ip: '108.174.10.10', block: true } ] } ]
// Check one domain (and IP)
rkn('linkedin.com', (err, res) => {
console.log(res)
});
// true
// Check error data
rkn(['hello.trololo', '127.0.0.hello'], (err, res) => {
console.log(res)
});
// [ { domain: 'hello.trololo', error: 'ENOTFOUND', ips: [] },
// { domain: '127.0.0.hello', error: 'ENOTFOUND', ips: [] } ]
© 2018 ExtensionsApp