2014-01-28 16:38:02 +00:00
|
|
|
function readSync(data, options) {
|
|
|
|
var zip, d = data;
|
|
|
|
var o = options||{};
|
|
|
|
switch((o.type||"base64")){
|
2014-01-30 03:06:14 +00:00
|
|
|
case "file":
|
|
|
|
if(typeof Buffer !== 'undefined') { zip=new jszip(d=_fs.readFileSync(data)); break; }
|
|
|
|
d = _fs.readFileSync(data).toString('base64');
|
2014-01-28 16:38:02 +00:00
|
|
|
/* falls through */
|
|
|
|
case "base64": zip = new jszip(d, { base64:true }); break;
|
|
|
|
case "binary": zip = new jszip(d, { base64:false }); break;
|
|
|
|
}
|
2014-02-07 10:53:40 +00:00
|
|
|
return parseZip(zip, o);
|
2014-01-28 16:38:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function readFileSync(data, options) {
|
|
|
|
var o = options||{}; o.type = 'file';
|
|
|
|
return readSync(data, o);
|
|
|
|
}
|
|
|
|
|
|
|
|
XLSX.read = readSync;
|
|
|
|
XLSX.readFile = readFileSync;
|
|
|
|
XLSX.parseZip = parseZip;
|