Skip to main content

Usage

Available function:

  • fetch()

Usage#

const RedditImageFetcher = require("reddit-image-fetcher");
// fetch 1 memeRedditImageFetcher.fetch({    type: 'meme'}).then(result => {    console.log(result);});
// fetch 1 wallpaperRedditImageFetcher.fetch({    type: 'wallpaper'}).then(result => {    console.log(result);});
// fetch 50 wallpapersRedditImageFetcher.fetch({    type: 'wallpaper',    total: 50}).then(result => {    console.log(result);});
// fetch 50 cat imagesRedditImageFetcher.fetch({    type: 'custom',    total: 50,     subreddit: ['cats', 'Catswhoyell', 'sleepingcats']}).then(result => {    console.log(result);});

Result#

Fetching

Options#

PropertyTypeDescriptionDefault
typestring'meme' | 'wallpaper' | 'custom''meme'
totalnumberHow many images to get. Max is 501
subreddit[string]Custom subreddit libray[ ]
addSubreddit[string]Add subreddits to subreddit library[ ]
removeSubreddit[string]Remove subreddits from subreddit library[ ]