From 17443b6cc69b04ec51c01947dd4a5622279b4527 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 1 Aug 2019 16:48:29 -0700 Subject: stream-to-blob@2 For https://github.com/brave/brave-browser/issues/5490 --- lib/file.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/file.js b/lib/file.js index 8bcfe22..993e06a 100644 --- a/lib/file.js +++ b/lib/file.js @@ -104,7 +104,8 @@ class File extends EventEmitter { getBlob (cb) { if (typeof window === 'undefined') throw new Error('browser-only method') - streamToBlob(this.createReadStream(), this._getMimeType(), cb) + streamToBlob(this.createReadStream(), this._getMimeType()) + .then(blob => cb(null, blob), cb) } getBlobURL (cb) { -- cgit v1.2.3