xsheetjs/bits/88_read.js
SheetJS dc2d391fbc version bump 0.6.0: avoid globals
- 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)
2014-04-15 02:04:03 -07:00

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);
}