<commit_before>node-aspsms
===========

A partial implementation of the [aspsms.com][aspsms] XML SMS API for
[node.js][node]. 

Installation
------------

    sudo npm install aspsms

Methods
-------

 - `setDefaultOptions(options)` Sets the default options
 - `send(options, callback, message)` Sends a text message
 - `showCredits(options, callback, message)` Returns the amount of credits left

Options
-------

 - `userkey` Your ASPSMS Uesrkey
 - `password` Your ASPSMS password
 - `originator` Name of the sender
 - `recipient` Mobile phone number of the recipient

Examples
--------

Send a text message

```javascript
var aspsms = require('aspsms');

aspsms.setDefaultOptions({
	'userkey' : 'YOUR_ASPSMS_USERKEY', 
	'password' : '<PASSWORD>', 
	'originator' : 'TestApp'
});

aspsms.send({
	'recipient' : '+41555123456'

}, function (error) {
	if (!error) {
		console.log('Success!');
	}
	
}, 'Hello, this is a test.');
```

Show hwo many credits I have left

```javascript
var aspsms = require('aspsms');

aspsms.setDefaultOptions({
	'userkey' : 'YOUR_ASPSMS_USERKEY', 
	'password' : '<PASSWORD>', 
});

aspsms.showCredits({ }, function (error, credits) {
	if (!error) {
		console.log('You have ' + credits + ' left');
	}
	
});
```
If you don't want to use `setDefaultOptions` you can pass all options in each
command.

```javascript
var aspsms = require('aspsms');

aspsms.send({
	'userkey' : 'YOUR_ASPSMS_USERKEY', 
	'password' : '<PASSWORD>', 
	'originator' : 'TestApp', 
	'recipient' : '+41555123456'

}, function (error) {
	if (!error) {
		console.log('Success!');
	}
	
}, 'Hello, this is a test.');
```


[aspsms]: http://www.aspsms.com/
[node]: http://nodejs.org/<commit_msg>Fixed typo added errors description<commit_after>node-aspsms
===========

A partial implementation of the [aspsms.com][aspsms] XML SMS API for
[node.js][node]. 

Installation
------------

    sudo npm install aspsms

Methods
-------

 - `setDefaultOptions(options)` Sets the default options
 - `send(options, callback, message)` Sends a text message
 - `showCredits(options, callback, message)` Returns the amount of credits left

Options
-------

 - `userkey` Your ASPSMS Uesrkey
 - `password` Your ASP<PASSWORD>
 - `originator` Name of the sender
 - `recipient` Mobile phone number of the recipient

Errors
------

If the operation was successfull the `error` object passed to the callback will
be `null`. If the operation fails the error object will contain an
`errorCode` and an `errorDescription` field with values according to the
[aspsms.com documentation][aspsmsdoc].

Examples
--------

Send a text message

```javascript
var aspsms = require('aspsms');

aspsms.setDefaultOptions({
	'userkey' : 'YOUR_ASPSMS_USERKEY', 
	'password' : '<PASSWORD>', 
	'originator' : 'TestApp'
});

aspsms.send({
	'recipient' : '+41555123456'

}, function (error) {
	if (!error) {
		console.log('Success!');
	}
	
}, 'Hello, this is a test.');
```

Show how many credits you have left

```javascript
var aspsms = require('aspsms');

aspsms.setDefaultOptions({
	'userkey' : 'YOUR_ASPSMS_USERKEY', 
	'password' : '<PASSWORD>', 
});

aspsms.showCredits({ }, function (error, credits) {
	if (!error) {
		console.log('You have ' + credits + ' left');
	}
	
});
```
If you don't want to use `setDefaultOptions` you can pass all options in each
command.

```javascript
var aspsms = require('aspsms');

aspsms.send({
	'userkey' : 'YOUR_ASPSMS_USERKEY', 
	'password' : '<PASSWORD>', 
	'originator' : 'TestApp', 
	'recipient' : '+41555123456'

}, function (error) {
	if (!error) {
		console.log('Success!');
	}
	
}, 'Hello, this is a test.');
```


[aspsms]: http://www.aspsms.com/
[aspsmsdoc] : http://aspsms.com/xml/doc/xmlsvr191.pdf
[node]: http://nodejs.org/
{'fraction_non_alphanumeric': 0.17430946634486458, 'fraction_numerical': 0.012603915258782515, 'mean_word_length': 4.026954177897574, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5336237', 'n_tokens_mistral': 1383, 'n_tokens_neox': 1284, 'n_words': 356}