Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
making our node implementation to output data for export
let textUtils = require('@redsift/text-utilities');
module.exports = function (got) {
// contains the key/value pairs that match the given query
const inData =;
console.log('counter: node1.js: running...',;
const json = => JSON.parse(d.value));
const others = json.filter(j => j.user !== j['from'].email);
let counts = => {
let text = value.textBody || value.strippedHtmlBody || '';
let count = textUtils.splitWords(textUtils.trimEmailThreads(text)).length;
return {
key: 'word_count',
value: count
console.log('counter: node1.js: will output:', counts);
return counts;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment