Last active
October 11, 2016 17:42
-
-
Save demosifter/d3bf49276282b0c6d700aff13564a164 to your computer and use it in GitHub Desktop.
Simple node implementation in server/node1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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