reddit-event
v1.0.10
Published
Get new posts with a event
Downloads
3
Readme
reddit-event
Get new posts of reddit with a event
Installation
$ npm i reddit-event
Usage
const Reddit = require('reddit-event');
const reddit = new Reddit();
.setLogging(boolean)
Logs when the package is looking through the subreddits, default: false | Returns: RedditClient
.setMinutes(number)
Sets the number of minutes to look for new posts, default: 1 | Returns: Promise<RedditClient>
.sub.add(string)
Adds a subreddit to be watched | Returns: Promise<RedditClient>
.sub.bulk.add(Array<string>)
Adds multiple subreddits to be watched | Returns: Promise<object>
.sub.remove(string)
Removes a subreddit from being watched | Returns: Promise<RedditClient>
.sub.bulk.remove(Array<string>)
Removes multiple subreddits to be watched | Returns: Promise<object>
.sub.list()
Lists all subreddits you have being watched | Returns: Array<string>
.on(event, callback)
Listen an event | Returns: RedditClient
.start()
This starts the operation to look for new posts | Returns: Promise<void>
Events
ready
Is emitted once the start function is called. | Callback: void
error
Is emitted once the package has an error | Callback: string
post
Is emitted once new posts from that subreddit is "new" | Callback: (string, Array)