node package manager


Node.js wrapper for Reddit API


Node.js wrapper for the Reddit API

  1. To create a nice node-friendly wrapper/client for the Reddit API.
  2. To learn how to create an API wrapper using superagent and request and share it using npm publish. (smackdown)

We'll look at npm publish and make the project available via

npm install _________ (project name here)

var Reddit = require('handson-reddit'); // working title

reddit = new Reddit();

reddit.r('funny', function (err, results) {


reddit.r('funny').new().exec(function (err, results) {


Support new(), controversial(), top()

reddit.login(username, password, function (err, success) {


Plus more calls from

  1. So you never have to do it again.
  2. So other people can use it to do amazing things.
  3. Feedback, contributions, the whole community thing.

git clone

cd handson-reddit

npm install

REDDIT_USERNAME=usernamehere REDDIT_PASSWORD=passwordhere make test

Check out the tests, check out a branch, make a test pass, submit a pull request, repeat.