node-reddit-js
A Node.js Reddit module that attempts to fully cover the Reddit API.
This is not done yet, currently YOU have to make the requests to the endpoints yourself, but soon it'll all be done in the background for you.
Examples
Importing the package:
// import the packageconst Reddit = // import only the client classconst Client =
Using the package - with credentials
const client = id: "APP_ID" secret: "APP_SECRET" username: "REDDIT_USERNAME" password: "REDDIT_PASSWORD" clientapiv1mekarma // GET https://oauth.reddit.com/api/v1/me/karma/*{ kind: 'KarmaList', data: [ { sr: 'dankmemes', comment_karma: 65, link_karma: 6985 }, { sr: 'memes', comment_karma: 231, link_karma: 6074 }, // ... ]}*/
Some endpoints don't require authorisation:
// don't authorise with the tokenclientredditnew // GET https://reddit.com/new/*{ kind: "Listing", data: { // ... }}*/
Using the package - without credentials
const client = clientredditrdankmemescommentsjiiz5o // GET https://www.reddit.com/r/dankmemes/comments/jiiz5o/*[ // post { kind: "Listing", data: { // ... } }, // comments { kind: "Listing", data: { // ... } }]*/
API
// The url changes from oauth.reddit.com to www.reddit.com if you're not authorising// i'll just use reddit.com here to keep things simple clientreddit // https://reddit.comclientapi // https://reddit.com/api (shortcut, client.reddit.api)clientv1 // https://reddit.com/api/v1 (shortcut again, client.reddit.api.v1 or client.api.v1) clientreddittop // https://reddit.com/topclientredditrsubreddit // https://reddit.com/r/subreddit client // https://reddit.com/r/subredditclientreddit"r/subreddit" // https://reddit.com/r/subreddit clientredditae"f" // https://reddit.com/a/b/c/d/e/f // Making requestsclientredditnewclientapiwhateveryouwant clientv1meprefs// any data you need to send or query onto the url goes into the data field