Skip to content

Instantly share code, notes, and snippets.

Created February 2, 2015 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/9f853345873a39a48b34 to your computer and use it in GitHub Desktop.
Save anonymous/9f853345873a39a48b34 to your computer and use it in GitHub Desktop.
excel to json
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