- Node.js Version: 12.2
- OS: macOs
- Scope (install, code, runtime, meta, other?): runtime
- Module (and version) (if relevant):
dns, net, tls
Quick question: is dns.lookup(url, 0, callback) supported as part of Node's API? The documentation says Must be 4 or 6, and any positive integer other than 4 or 6 will return a TypeError [ERR_INVALID_OPT_VALUE]: The value "2" is invalid for option "family". But passing in 0 does not error. Is this expected? If so, is this something stable that developers can rely on?
// The following are all expected to workdns.lookup('www.google.com',4,err=>{console.log(err);// null});dns.lookup('www.google.com',6,err=>{console.log(err);// null});dns.lookup('www.google.com',err=>{console.log(err);// null});// The following should errortry{dns.lookup('www.google.com',1,()=>{});}catch(e){console.log(e);// TypeError [ERR_INVALID_OPT_VALUE]: The value "1" is invalid for option "family"}try{dns.lookup('www.google.com',2,()=>{});}catch(e){console.log(e);// TypeError [ERR_INVALID_OPT_VALUE]: The value "2" is invalid for option "family"}try{dns.lookup('www.google.com',3,()=>{});}catch(e){console.log(e);// TypeError [ERR_INVALID_OPT_VALUE]: The value "3" is invalid for option "family"}try{dns.lookup('www.google.com',5,()=>{});}catch(e){console.log(e);// TypeError [ERR_INVALID_OPT_VALUE]: The value "5" is invalid for option "family"}// Asking about this one:dns.lookup('www.google.com',0,err=>{console.log(err);// null <-- is this correct?});
dns,net,tlsQuick question: is
dns.lookup(url, 0, callback)supported as part of Node's API? The documentation saysMust be 4 or 6, and any positive integer other than 4 or 6 will return aTypeError [ERR_INVALID_OPT_VALUE]: The value "2" is invalid for option "family". But passing in0does not error. Is this expected? If so, is this something stable that developers can rely on?