forked from sheetjs/sheetjs
SheetJS
dc2d391fbc
- all utilities are now wrapped in XLSX object - codepage handling (h/t @xch89820) - formula tag attributes (h/t @shaunthomas999) - hyperlink support (h/t @sysarchitect, fixes #55) - coverage test spinner (to prevent travis timeouts)
20 lines
546 B
JavaScript
20 lines
546 B
JavaScript
function readSync(data, options) {
|
|
var zip, d = data;
|
|
var o = options||{};
|
|
switch((o.type||"base64")){
|
|
case "file":
|
|
if(typeof Buffer !== 'undefined') { zip=new jszip(d=_fs.readFileSync(data)); break; }
|
|
d = _fs.readFileSync(data).toString('base64');
|
|
/* falls through */
|
|
case "base64": zip = new jszip(d, { base64:true }); break;
|
|
case "binary": zip = new jszip(d, { base64:false }); break;
|
|
}
|
|
return parseZip(zip, o);
|
|
}
|
|
|
|
function readFileSync(data, options) {
|
|
var o = options||{}; o.type = 'file';
|
|
return readSync(data, o);
|
|
}
|
|
|