Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
requiring text-utils
let textUtils = require('@redsift/text-utilities');
// ...
let counts = others.map(value => {
let text = value.textBody || value.strippedHtmlBody || '';
let count = textUtils.splitWords(textUtils.trimEmailThreads(text)).length;
return count;
});
console.log(counts);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment