But i want to be able assign the return result to a variable then send that to the front end. But the variable comes up as undefined. Any help?
var nodePandoc = require('node-pandoc');
var src, args;
var file = '';
src = 'Lesson.docx';
args = '-f docx -t markdown -o ./Lesson.md';
callback = function (err, result) {
if (err) return console.error('Oh No: ',err);
console.log("callback result:",result);
file = result
};
nodePandoc(src, args, callback);
console.log(file);
see stack overflow question
But i want to be able assign the return result to a variable then send that to the front end. But the variable comes up as undefined. Any help?