Bah, as per usual after posting for help.. i get it working.. here is the final code
var prettyjson = require('prettyjson'),
fs = require('fs'),
StompClient = require('stomp-client').StompClient;
var destination = '/topic/(topic)',
client = new StompClient('datafeeds.(datafeed)', 61618, '(email.address)', '(password)', '1.0');
client.connect(function(sessionId) {
console.log('Trying to connect...');
client.subscribe(destination, function(body, headers) {
fs.writeFile("./output", prettyjson.render(JSON.parse(body)), function(err) {
if(err) {
console.log(err);
} else {
console.log("The file was saved!");
}
});
});
});