Socket
Socket
Sign inDemoInstall

@vedantsharma/reddit

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vedantsharma/reddit

Reddit Library for Nodejs and Typescript


Version published
Maintainers
1
Weekly downloads
11

Weekly downloads

Readme

Source

Reddit Scraper

About

@vedantsharma/reddit is a nodejs library coded using javascript to make work for coders who are using the raw reddit api to make there lives easier. Thanks to Ric and Sam for helping me remove the irrelevant part and fixing bugs.

Errors

If you guys face errors while using this library then make an issue. I'm currently busy with exams and will fix them later.

Installation

npm install @vedantsharma/reddit

Overview

The parameters are optional. So... the default subreddits are "dankmemes" and "wholesomememes".

Below are the Given Methods.

getRandom();
getLast();
getFirst();

before using all this, you have to set up the instances, which is by doing the given:

import {Scraper} from "@vedant/reddit";
const a = new Scraper();

Usages/Examples

  • Typescript
import {Scraper} from "@vedantsharma/reddit";

const manager = new Scraper();

const post = await manager.getFirst('funny'); // Leaving this empty would use the default subreddits as given on 
console.log(post); // Print out the Reddit Post Object.
console.log(post.title); // Print out the title of the reddit post.
  • Javascript
const lib = require("@vedantsharma/reddit");

const manager = new lib.Scraper();
manager.getFirst('funny').then(post => {
    console.log(post);
});

Keywords

FAQs

Last updated on 30 Mar 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc