npm.io
0.1.0 • Published 2 years ago

@qgisk/simple-reddit-client

Licence
MIT
Version
0.1.0
Deps
0
Size
21 kB
Vulns
0
Weekly
0

simple-reddit-client

npm version npm downloads

Install

npm i @qgisk/simple-reddit-client

Usage

import fetch from 'cross-fetch'
import RedditClient from '@qgisk/simple-reddit-client'

const Client = new RedditClient({allowNSFW: false, imagesOnly: false, ignoreGiphy: false, limit: 25}, fetch)

const getPicsInfo = await Client.getInfo({page: 'pics', type: 'r'})
const getPictures = await Client.getPosts({pages: 'pics', type: 'r', allowNSFW: false, imagesOnly: true, ignoreGiphy: true, limit: 25, sortType: 'hot'}) // Also accepts after, for pagination

console.log(getPicsInfo, getPictures)

MIT Demian