aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/stringstream/example.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/stringstream/example.js')
-rw-r--r--deps/npm/node_modules/stringstream/example.js27
1 files changed, 0 insertions, 27 deletions
diff --git a/deps/npm/node_modules/stringstream/example.js b/deps/npm/node_modules/stringstream/example.js
deleted file mode 100644
index f82b85edc7..0000000000
--- a/deps/npm/node_modules/stringstream/example.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var fs = require('fs')
-var zlib = require('zlib')
-var strs = require('stringstream')
-
-var utf8Stream = fs.createReadStream('massiveLogFile.gz')
- .pipe(zlib.createGunzip())
- .pipe(strs('utf8'))
-
-utf8Stream.pipe(process.stdout)
-
-// Stream from utf8 to hex to base64... Why not, ay.
-var hex64Stream = fs.createReadStream('myFile')
- .pipe(strs('utf8', 'hex'))
- .pipe(strs('hex', 'base64'))
-
-hex64Stream.pipe(process.stdout)
-
-// Deals with base64 correctly by aligning chunks
-var stream = fs.createReadStream('myFile').pipe(strs('base64'))
-
-var base64Str = ''
-
-stream.on('data', function(data) { base64Str += data })
-stream.on('end', function() {
- console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()
- console.log('Original file is: ' + new Buffer(base64Str, 'base64'))
-})