-
Notifications
You must be signed in to change notification settings - Fork 237
This library pre-1.x is comprised of patterns and an API that has been mostly un-changed since its inception. The 1.x branch is an effort to:
- Introduce a more standard callback pattern https://github.com/desmondmorris/node-twitter/issues/23
- Support for all 1.1 and future endpoints
- Add test coverage (Planned)
- Add better examples and documentation (Planned)
There are two major changes in 1.x:
An updated callback pattern
This has been the most popular feature request in this project and rightfully so.
The new callback pattern is as follows:
/**
* I am a callback.
*
* error An error object
* body The payload from the API request
* response The raw response object from the oauth request. We will keep this in case folks are using it in some way.
*/
function(error, body, response) {}
Previously, the error
and payload
arguments were ambigous (in the same argument position), causing all sorts of mayhem.
Deprecate the helper modules
So .getFavorites(callback)
becomes .get('favorites/list')
.
Why? Because the helper methods do not scale, meaning - as the API changes we will need to update the helper methods accordingly.
Deprecate the authentication strategy
I suggest taking a looking at the Passport's Twitter strategy if you are looking to use Twitter as an authentication method.