manuelvanrijn/node-realurl — pull request #2 by lukekarrys (2013-03-16 19:11:45+00:00)
Title: Change order of error and result arguments in callback

### *Warning: this is a breaking change!*

However, I think it is the right change to make. The main reason is that this change allows the module to work with [async](https://npmjs.org/package/async). Previously this module woud not work with async methods such as [concat](https://github.com/caolan/async#concat). With this change you can do code like this, since async passes an iterator with a callback that looks like `callback(err, results)`.

```javascript
async.concat(arrayOfShortUrls, realurl.get, function(err, longUrls){ });
```

I also made a few other cleanup changes. Forgive me if I'm being too opinionated.

- Errors are now passed back as `new Error(message)` instead of as strings in the result argument. See [http://www.devthought.com/2011/12/22/a-string-is-not-an-error/](http://www.devthought.com/2011/12/22/a-string-is-not-an-error/) for some reasons why.
- JSHint config options have been moved to the standard `.jshintrc` file and are being read from that file by Grunt. This allows other implementations of JSHint (such as editor plugins) to read the options as well.

Readme and tests have also been updated to reflect all changes.