Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reddit-api-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reddit-api-wrapper

Easy-to-use wrapper for the Reddit API. Get Reddit data more efficiently and effectively.

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

npm version

downloads

NPM Package

Reddit API Wrapper

A simple, easy-to-use wrapper for the Reddit API. This Node.js package abstracts the complexities of interacting with Reddit's API, providing a straightforward interface for fetching posts from Reddit.

Installation

Install via npm:

npm install reddit-api-wrapper

Usage

Here's how you can use this package:

const reddit = require('reddit-api-wrapper');

// Fetch top posts from all of Reddit
reddit
  .getPosts('top')
  .then((posts) => console.log(posts))
  .catch((error) => console.error(error));

// Fetch top posts from a specific subreddit
reddit
  .getPostsBySubreddit('programming', 'top')
  .then((posts) => console.log(posts))
  .catch((error) => console.error(error));
s;

API

This package provides the following functions:

getPosts(filter): Fetches posts from the front page of Reddit. If a filter is provided (e.g., 'top', 'hot', 'best'), fetches posts using that filter.

getPostsBySubreddit(subreddit, filter): Fetches posts from a specific subreddit. If a filter is provided (e.g., 'top', 'hot', 'best'), fetches posts using that filter.

FAQs

Package last updated on 06 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc