Usage
Available function:
- fetch()
#
Usageconst 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);});
#
ResultFetching
#
OptionsProperty | Type | Description | Default |
---|---|---|---|
type | string | 'meme' | 'wallpaper' | 'custom' | 'meme' |
total | number | How many images to get. Max is 50 | 1 |
subreddit | [string] | Custom subreddit libray | [ ] |
addSubreddit | [string] | Add subreddits to subreddit library | [ ] |
removeSubreddit | [string] | Remove subreddits from subreddit library | [ ] |