A one-line change makes this library usable in nodejs without breaking browser usage. This PR adds that line.
In current node versions, Buffer extends Uint8Array, so the following works:
var UZIP = require("uzip");
var zip = UZIP.parse(fs.readFileSync("sheetjs.xlsx"));
Object.keys(zip); // list of entries
Buffer.from(zip['[Content_Types].xml']).toString() // contents of `[Content_Types].xml` as text
In addition, there were some trailing whitespace characters that were removed. A proper lint configuration (like jscs/jshint or eslint) is probably a good idea.
We also took the liberty of publishing "version 0.0.0" to npm: https://www.npmjs.com/package/uzip . NPM user ~photopea has been added as an owner, feel free to remove ~sheetjs from the owner list using the npm owner CLI command.
A one-line change makes this library usable in nodejs without breaking browser usage. This PR adds that line.
In current node versions, Buffer extends Uint8Array, so the following works:
In addition, there were some trailing whitespace characters that were removed. A proper lint configuration (like jscs/jshint or eslint) is probably a good idea.
We also took the liberty of publishing "version 0.0.0" to npm: https://www.npmjs.com/package/uzip . NPM user
~photopea
has been added as an owner, feel free to remove~sheetjs
from the owner list using thenpm owner
CLI command.