Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.35 KB

README.md

File metadata and controls

50 lines (34 loc) · 1.35 KB

fetch-reddit

Build Status Dependency Status devDependency Status

A utility function for fetching links from subreddits or Reddit comment threads. Used by rplayr, an app to generate playlists from Reddit URLs.

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