I have the following code:
function done(err, file) {
//handle code
return "test";
}
function process() {
retext()
.use(keywords)
.process(sentence, done);
return val;
}
The process()
function must return the value of retext()
, but the retext()
function doesn't seem to return anything.
If I change it to:
const val = retext()
.use(keywords)
.process(sentence, done);
That still doesn't work
How can I get retext()
to return something. It is just an NPM package I installed
I tried returning test
in the done()
function but that doesn't pass anything to return to retext()
.
I have also tried:
retext()
.use(keywords)
.process(params.t, done).then((val) => return val);
To summarise:
process()
must return the value of done()
, which is called by retext()