Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(async (resolve, reject) => {
retext()
.use(keywords, {
maximum
})
.process(text, done);
function done(err, file) {
if (err) throw err;
let keyphrases: string[] = [];
file.data.keyphrases.forEach(function(phrase) {
keyphrases.push(phrase.matches[0].nodes.map(toString).join(""));
});
resolve(keyphrases);
}
});
}