Skip to content

Instantly share code, notes, and snippets.

@demosifter
Last active October 11, 2016 17:42
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/d3bf49276282b0c6d700aff13564a164 to your computer and use it in GitHub Desktop.
Save demosifter/d3bf49276282b0c6d700aff13564a164 to your computer and use it in GitHub Desktop.
Simple node implementation in server/node1.js
module.exports = function (got) {
// got.in contains the key/value pairs that match the given query
const inData = got.in;
console.log('counter: node1.js: running...', inData.data);
const json = inData.data.map(d => JSON.parse(d.value));
json.forEach(function(value, i){
console.log('datum#', i, 'value:', value)
})
return [{
key: 'dataLength',
value: json.length
}];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment