diff --git a/lib/bing.js b/lib/bing.js index d4b4f0d..1ce78f8 100644 --- a/lib/bing.js +++ b/lib/bing.js @@ -1,7 +1,7 @@ -/************************************************************** +/********************************************************* * Simple Node.js module for using the Bing Search API * - **************************************************************/ + *********************************************************/ // Require dependencies var request = require('request'), @@ -65,7 +65,15 @@ Bing.prototype.search = function(query, callback, options) { }, timeout: opts.reqTimeout - }, callback); + }, function(err, res, body){ + + // Parse body, if body + body = typeof body === 'string' + ? JSON.parse(body) + : body; + + callback(err, res, body); + }); }; module.exports = Bing;