1.0.8 • Published 3 years ago
simple-reddit v1.0.8
simple-reddit
Simple client for the reddit public api. (No auth needed)
Get it from npm
npm i simple-reddit --save
Import
const Reddit = require("simple-reddit");
or just import individual functions.
const {topPost} = require("simple-reddit");
Usage
Basic examples:
Get top post from reddit.
RedditSimple.TopPost(options).then(res => {
console.log(res);
})
Options
There are 4 options that you can pass.
Name | Value | Description | Default |
---|---|---|---|
subreddit | name of subreddit | Subreddit to fetch the post. | r/all |
count | Number of posts to retrieve | Retrieves n number of posts. | 1 (max:100) |
is_meme | true/false | If you want to get a meme. Ignores subreddit option if true. | false |
fulldata | true/false | Retrieve essential post data or everything reddit has to offer. | false |