Skip to content

Instantly share code, notes, and snippets.

@demosifter
Last active October 15, 2016 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save demosifter/318ee149c56c4e6645b1f2c46cd71ca6 to your computer and use it in GitHub Desktop.
Save demosifter/318ee149c56c4e6645b1f2c46cd71ca6 to your computer and use it in GitHub Desktop.
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