var drop = require('drag-and-drop-files')
var concat = require('concat-stream')
var fileReaderStream = require('filereader-stream')
var zlib = require('zlib')

drop(document.body, function(files) {
  var first = files[0]
  console.log("start gzip " + first.name);
  console.time("gzip")
  gzip = zlib.createGzip({'level':1})
  gunzip = zlib.createGunzip()
  datin = fileReaderStream(first)
  datin.pipe(gzip)
  gzip.pipe(gunzip)
  gunzip.setEncoding('utf8')
  var count = 0
  gunzip.on('data', function(chunk) { count = count + chunk.length; })
  gunzip.on('finish', function() { console.log("done, got " + count + " 
bytes"); console.timeEnd("gzip") })
  gunzip.on('close', function() { console.log("closed, got " + count + " 
bytes"); console.timeEnd("gzip") })
  gunzip.on('error',
      function(err) {
        console.log("error, got " + count + " bytes");
        console.log(err.message)
        console.log(err.stack)
        console.timeEnd("gzip")
      })
})

<https://lh3.googleusercontent.com/-CKZ9f59ovIE/Vq6owUjsUcI/AAAAAAAADdA/zFnG2OLzY5w/s1600/nodejs-crash.png>


It's day one for me with javascript and nodejs. I have no idea. I cobbled 
this together, built with:

browserify -e ./ > try-build.js

and this .html file

<html>
  <body>
    Drop something on me
  </body>
  <script src='try-build.js'></script>
</html>

Crashes similarly in safari and chrome when I drop 4GB file on it. I'd 
appreciate any suggestions. Here's all I installed:

  npm install filereader-stream
  npm install drag-and-drop-files
  npm install concat-stream

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/59751c39-b97c-49f8-87da-115a594db750%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to