fetch-reddit

Easily fetch links from Reddit subs and threads

Usage no npm install needed!

<script type="module">
  import fetchReddit from 'https://cdn.skypack.dev/fetch-reddit';
</script>

README

fetch-reddit

Build Status Dependency Status devDependency Status

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