Skip to content

Instantly share code, notes, and snippets.

@joepie91
Forked from anonymous/gist:9f853345873a39a48b34
Created February 2, 2015 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joepie91/807f3180e58963640b65 to your computer and use it in GitHub Desktop.
Save joepie91/807f3180e58963640b65 to your computer and use it in GitHub Desktop.
exports.convertXLSXToJSON2 = function(req, res) {
var path = fileServerPath + req.body.name;
console.log("starting..." + path);
var exists = fs.existsSync(path);
console.log("path exists? " + exists);
console.log("in xlsx to json 2 method...starting conversion");
try {
var obj = asyncXLSX.parse(path);
console.log("obj: " + obj);
res.send(obj);
console.log("end conversion")
}
catch(ex) {
//console.log("throwing error");
console.log("throwing error: " + ex.message);
res.send(ex.message);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment