npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

reddit-client-api

v0.0.8

Published

Node.js / TypeScript client for Reddit API

Readme

Reddit API CLient

TypeScript client for the Reddit API.

⚠️This is not finished.⚠️ It does not implement the full Reddit API. https://www.reddit.com/dev/api/

If you are looking for an npm package for accessing the reddit api. The Offical Reddit Client may be the one you are looking for https://github.com/reddit/node-api-client

Introduction

The purpose of this repo is to create a Reddit Client with TypeScript. I'm on a TypeScript learning journey so I reckon this is a great way to learn.

If you are also interested in learning TypeScript feel free to contribute.

Read the Contributing Guide to get started. Then pick an endpoint from the Reddit API docs and create a pull request.

Just be sure to add unit and e2e tests 🙏🏼

Goals

  • [ ] Include most the official Reddit api endpoints
  • [ ] Promise-based
  • [ ] Fully typed. Both for query parameters and responses.

Work in Progress

Endpoints Completed so far:

Mostly the 'listing section' https://www.reddit.com/dev/api/#section_listings

  • /api/v1/access_token
  • /new/
  • /r/subreddit/new/
  • /hot/
  • /r/subreddit/hot/
  • /rising/
  • /r/subreddit/rising/
  • /hot/
  • /r/subreddit/hot/
  • /r/best/
  • /r/subreddit/best/

Where subreddit is the name of the subredit

Install

    npm i reddit-client-api

Usage

    import RedditClient from "reddit-client-api";

    const config = {
      apiKey: `${process.env.REDDIT_APIKEY}`,
      apiSecret: `${process.env.REDDIT_APISECRET}`,
      userAgent: `${process.env.USERAGENT}`,
    };
    const myRedditClient = new RedditClient(config);
    await myRedditClient.auth({ username: `${process.env.USERNAME}`, password: `${process.env.PASSWORD}` });

    // get Rising Posts limited to 2 posts per page and 2 pages
    const risingPosts = await myRedditClient.getRisingPosts(2, 2);
    // get Rising Posts by Subreddit sideproject
    const risingSideprojectPosts = await myRedditClient.getRisingPostsBySubreddit('sideproject', 2, 2);

    // get New Posts limited to 2 posts per page and 2 pages
    const newPosts = await myRedditClient.getNewPosts(2, 2);
    // get New Posts by Subreddit sideproject
    const newSideprojectPosts = await myRedditClient.getNewPostsBySubreddit('sideproject', 2, 2);

    // get Hot Posts limited to 2 posts per page and 2 pages
    const hotPosts = await myRedditClient.getHotPosts(2, 2);
    // get Hot Posts by Subreddit sideproject
    const hotSideprojectPosts = await myRedditClient.getHotPostsBySubreddit('sideproject', 2, 2);

    // get Hot Posts limited to 2 posts per page and 2 pages
    const bestPosts = await myRedditClient.getBestPosts(2, 2);
    // get Hot Posts by Subreddit sideproject
    const bestSideprojectPosts = await myRedditClient.getBestBySubreddit('sideproject', 2, 2);


    // get duplicate posts
    const duplicateListingForPost = await myRedditClient.getPostDuplicate(postID);
    // get random
    const randomPost = await myRedditClient.getRandom();

License

This project is licensed under the MIT License

Get Help

Reach out on https://thefullstack.network/u/jamie Open an issue on GitHub

Contributions

The goal of this repo is to learn TypeScript so please feel free to contribute. Pull requests are always welcome, and I'll do my best to do reviews as fast as I can.

In the case of a bug report, bugfix or a suggestions, please feel very free to open an issue too.

Please refer to the contribution guide to see how to get started.

References

https://www.reddit.com/dev/api/