var restify = require('restify') , util = require('util') , EventEmitter = require('events').EventEmitter; var COSM = function(streams, key) { var self = this; var streams = streams; var interval = 1000; var jsonClient = restify.createJsonClient({ url: 'http://api.cosm.com', headers: { 'X-ApiKey': key }, version:'*' }); var recentvalues = {}; setInterval(function() { for(var i=0; i