This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/duplexify/example.js

22 lines
370 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
var duplexify = require('duplexify')
var http = require('http')
var request = function(opts) {
var req = http.request(opts)
var dup = duplexify()
dup.setWritable(req)
req.on('response', function(res) {
dup.setReadable(res)
})
return dup
}
var req = request({
method: 'GET',
host: 'www.google.com',
port: 80
})
req.end()
req.pipe(process.stdout)