Skip to content

Instantly share code, notes, and snippets.

@despairblue
Created July 28, 2016 14:33
Show Gist options
  • Save despairblue/c32f227cc34859c46f7030620c35985b to your computer and use it in GitHub Desktop.
Save despairblue/c32f227cc34859c46f7030620c35985b to your computer and use it in GitHub Desktop.
does not work with node > 5.9.1
'use strict'
const imageSizeStream = require('image-size-stream')
const fs = require('fs')
const through2 = require('through2')
const s = fs.createReadStream('./test/http/listings/fixtures/image-upload/weird.jpg')
const s2 = through2(s)
const is = imageSizeStream({ limit: Infinity })
.on('size', console.log)
.on('error', console.error)
const is2 = imageSizeStream({ limit: Infinity })
.on('size', console.log)
.on('error', console.error)
// s.pipe(is)
s2.pipe(is2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment