random-bunny/readme.md
2016-04-27 15:12:06 -04:00

1,015 B

random-puppy Build Status

Get a random puppy image url.

Install

$ npm install --save random-puppy

Usage

const randomPuppy = require('random-puppy');

randomPuppy()
    .then(url => {
        console.log(url);
    })

//=> 'http://imgur.com/IoI8uS5'

API

randomPuppy()

Returns a promise for a random puppy image url from http://imgur.com/ from https://www.reddit.com/r/puppy

randomPuppy(subreddit)

Returns a promise for a random image url from the selected subreddit. Warning: We cannot promise it will be a image of a puppy!

Notes

  • Node 4 or newer.
  • Caches results from imgur in memory.
  • Created for the purpose of using in a training exercise on different ways to do async in JavaScript at Opower.

License

MIT © Dylan Greene