In the following example, running node v7.10.0 I get
TypeError: me.error is not a function
at Writer (/Users/berger/workspace/inexor-flex/node_modules/unzip/node_modules/fstream/lib/writer.js:34:23)
at new Extract (/Users/berger/workspace/inexor-flex/node_modules/unzip/lib/extract.js:30:16)
at Object.Extract (/Users/berger/workspace/inexor-flex/node_modules/unzip/lib/extract.js:16:12)
at repl:1:17
at ContextifyScript.Script.runInThisContext (vm.js:23:33)
at REPLServer.defaultEval (repl.js:339:29)
at bound (domain.js:280:14)
at REPLServer.runBound [as eval] (domain.js:293:12)
at REPLServer.onLine (repl.js:536:10)
at emitOne (events.js:101:20)
The example code is
const unzip = require('unzip')
const fs = require('fs')
const path = require('path')
const process = require('process')
let filePath = path.join(process.cwd(), 'somezip.zip')
let file = fs.createReadStream(filePath)
.pipe(unzip.Extract({
path: filePath.substr('.zip', '')
}))
In the following example, running
node v7.10.0
I getThe example code is
Am I using
unzip
wrong here?