Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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