(filename, options)
| 30 | } |
| 31 | |
| 32 | async readFile(filename, options) { |
| 33 | options = options || {}; |
| 34 | if (!(await exists(filename))) { |
| 35 | throw new Error(`File not found: ${filename}`); |
| 36 | } |
| 37 | const stream = fs.createReadStream(filename); |
| 38 | const worksheet = await this.read(stream, options); |
| 39 | stream.close(); |
| 40 | return worksheet; |
| 41 | } |
| 42 | |
| 43 | read(stream, options) { |
| 44 | options = options || {}; |