Comparing version 0.0.2 to 0.0.3
@@ -39,7 +39,3 @@ /*! | ||
} else { | ||
callback(null,{ | ||
id : results.messages[0]['message-id'], | ||
price : results.messages[0]['message-price'], | ||
balance : results.messages[0]['remaining-balance'] | ||
}); | ||
callback(null,results); | ||
} | ||
@@ -46,0 +42,0 @@ } |
@@ -14,3 +14,3 @@ { | ||
"engine": "node >= 0.4.1", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"files": [ | ||
@@ -17,0 +17,0 @@ "index.js", |
@@ -7,14 +7,22 @@ # node-nexmo | ||
```javascript | ||
var nexmo = require('nexmo')({key: 'key', secret: 'key'}); | ||
var nexmo = require('nexmo')({key: 'key', secret: 'secret'}); | ||
var message = nexmo.sms({to: 'to', from: 'from', text: 'Welcome to Nexmo on Node!'}); | ||
// Send an SMS message | ||
var message = nexmo.sms({to: 'to', from: 'from', text: 'Welcome to Nexmo from Node!'}); | ||
message.send(function(err, results) { | ||
if (err) { | ||
console.log('Nexmo error: ' + err); | ||
} else { | ||
console.log('Message ID: ' + results.id + ' sent!'); | ||
if (!err) { | ||
console.log('Your message was delivered in ' + results['message-count'] + ' part(s)!'); | ||
} | ||
}); | ||
// ... or check your account balance | ||
nexmo.account.balance(function(err, balance) { | ||
if (!err) { | ||
console.log('Your account balance is: ' + balance); | ||
} | ||
}); | ||
``` | ||
@@ -21,0 +29,0 @@ |
@@ -33,5 +33,6 @@ /*! | ||
if (results) { | ||
test.notEqual(results.id,null); | ||
test.notEqual(results.price,null); | ||
test.notEqual(results.balance,null); | ||
test.notEqual(results['message-count'],null); | ||
test.notEqual(results.messages[0]['message-id'],null); | ||
test.notEqual(results.messages[0]['remaining-balance'],null); | ||
test.notEqual(results.messages[0]['message-price'],null); | ||
} | ||
@@ -38,0 +39,0 @@ test.done(); |
6540
41
187