README
fetch-reddit
A utility function for fetching links from subreddits or Reddit comment threads
Usage
npm install fetch-reddit --save
import { getPosts } from 'fetch-reddit'
function processPosts (posts) {
// Do something with the extracted posts
}
getPosts('/r/chillmusic').then(data => {
// Array of extracted posts
processPosts(data.posts)
// Easy pagination
data.loadMore().then(processPosts)
})
Linting
This project uses standard code style.
npm run lint
Testing
This project uses mocha with chai assertions for unit testing.
npm run test
Thanks
- Big thanks to koistya for babel-starter-kit, which this repo is roughly based on.