summaryrefslogtreecommitdiffstats
path: root/node_modules/memorystream/test/example.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/memorystream/test/example.js')
-rw-r--r--node_modules/memorystream/test/example.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/node_modules/memorystream/test/example.js b/node_modules/memorystream/test/example.js
new file mode 100644
index 0000000..7d94369
--- /dev/null
+++ b/node_modules/memorystream/test/example.js
@@ -0,0 +1,18 @@
+var http = require('http'),
+ MemoryStream = require('../index'),
+ util = require('util');
+
+var options = {
+ host: 'google.com'
+};
+var memStream = new MemoryStream(null,{
+ readable : false
+});
+
+var req = http.request(options, function(res) {
+ util.pump(res, memStream);
+ res.on('end',function(){
+ console.log(memStream.toString());
+ });
+});
+req.end();