node.js' equivalent of Haskell's "interact" function.