diff --git a/README.md b/README.md index 4674fda1..4e116f4c 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,13 @@ user.orgs(function(err, orgs) {}); List authenticated user's gists. ```js -user.gists(username, function(err, gists) {}); +user.gists(function(err, gists) {}); +``` + +List unread notifications for the authenticated user. + +```js +user.notifications(function(err, notifications) {}); ``` Show user information for a particular username. Also works for organizations. diff --git a/github.js b/github.js index ac8749c6..5ffe0ac1 100644 --- a/github.js +++ b/github.js @@ -86,6 +86,15 @@ }); }; + // List authenticated user's unread notifications + // ------- + + this.notifications = function(cb) { + _request("GET", "/notifications", null, function(err, res) { + cb(err,res); + }); + }; + // Show user information // -------