All Downloads are FREE. Search and download functionalities are using the official Maven repository.

node_modules.duplexify.example.js Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
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)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy