Hi, I'm looking for a good solution to be able to detect if this feature exists in the runtime my module is running on so I can throw if it's not supported. It was suggested on IRC to make an issue here.
I originally thought perhaps if I just construct a duplex stream and pass it into tls.connect, but it doesn't seem to throw an error on pre-1.4.1 versions. Suggestions?
// This doesn't seem to workvarsupportswrappedjsstreams=(function(){vars=require("stream").Duplex();s._read=s._write=function(){};try{require("tls").connect({stream: s});returntrue;}catch{returnfalse;}});// This does work, but not sure if this is going to suddenly break in the futurevarsupportswrappedjsstreams=(function(){try{require("_stream_wrap");returntrue;}catch{returnfalse;}});
Hi, I'm looking for a good solution to be able to detect if this feature exists in the runtime my module is running on so I can throw if it's not supported. It was suggested on IRC to make an issue here.
I originally thought perhaps if I just construct a duplex stream and pass it into
tls.connect, but it doesn't seem to throw an error on pre-1.4.1 versions. Suggestions?