diff --git a/lib/index.js b/lib/index.js index 97bd09c..d397750 100644 --- a/lib/index.js +++ b/lib/index.js @@ -60,7 +60,7 @@ Instapush.prototype.request = function (method, url,data, callback) { headers: headers, json: data }, function (err, response, body) { - console.log(protocole+'://'+self.url+'/'+self.version+'' + url); +// console.log(protocole+'://'+self.url+'/'+self.version+'' + url); if (err) return callback(err); if (response.code < 200 || response.code > 302) return callback(body); callback(null, body); @@ -135,5 +135,14 @@ Instapush.prototype.addApp = function (data, callback) { /** * Export */ -module.exports = new Instapush(); +// module.exports = new Instapush(); +// respectfully: the above line is unfortunate, as it prevents the creation of multiple Instapush objects +module.exports = Instapush; + +/* to be backwards compatible with 1.0.1, callers should use: + + var instapush = require('instapush'); + if (typeof instapush === 'function') instapush = new instapush(); + + */ diff --git a/package.json b/package.json index 26df97a..69db69a 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "api", "client" ], - "version": "1.0.1", + "version": "1.1.0", "main": "lib/index.js", "dependencies": { "request": "~2.12.0"