Skip to content

How to assign the return value to a variable #10

@jakecush1

Description

@jakecush1

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?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions