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 🙏

© 2024 – Pkg Stats / Ryan Hefner

replapi-fixed

v1.1.6

Published

A wrapper for Repl.it's GraphQL (and soon REST and even Crosis) API. Designed to be easy to use!

Downloads

7

Readme

Contributors Forks Stargazers Issues MIT License

About The Project

Code Screenshot

The Repl.it GraphQL API is an extraordinary way to make projects unique and special, yet with the numerous packages available few such projects have been made. Why would that be? Most likely due to how complicated writing code can get and the limitations of their queries. My package, ReplAPI.it, changes that with a simple to use structure and many queries, some of which are:

  • Queries for Data on Users (such as Profile, Posts, Comments)
  • Queries for Data on Posts (such as Upvoters, Content)
  • Queries for Data on Notifications (such as Reply Notifications, Achievement Notifications)
  • Mutations for Commenting, Reporting, and Posting
  • Queries for Data on Leaderboard (with filters such as cycles since)
  • and lots more!

My package is also simple to use with it's class-based structure. Simply create a new class for you User, Post, or whatever you heart desires and use built in functions with options to query data your way.

Built With

Getting Started

I suggest requiring the ReplAPI.it module until ES imports in NodeJS are stabilized.

Prerequisites

If you have not already download npm:

  • npm
    npm install npm@latest -g

Installation

  1. Install the latest version of the package
    $ npm install replapi-it
  2. Require the package in your code
    const repl = require('replapi-it');

Usage

Using ReplAPI.it is very simple! Let's create a simple user and ask for their cycles:

const repl = require('replapi-it');

const myUser = new repl.User("RayhanADev");

async function getCycles() {
 let info = await myUser.profileData();
 let cycles = info.karma; // Yep, it's karma!
 console.log(`User Cycles: ${cycles}`)
}

getCycles()

Output:

User Cycles: 1008

That was fun! Now how about getting a specific post? Let's create a simple post and ask for it's title:

const repl = require('replapi-it');

const myPost = new repl.Post(78043);

async function getTitle() {
 let info = await myPost.postData();
 let title = info.title;
 console.log(`Post Title: ${title}`)
}

getTitle()

Output:

Post Title: Presenting... 🤔 RayhanADev 🤔? (GraphQL Success!)

For more examples, please refer to the Documentation

Roadmap

See the open issues for a list of proposed features (and known issues).

I'm considering adding in support for Crosis communications after they distribute developer keys again. Right now I'm experimenting with WSS and eval.repl.it for code execution!

Contributing

Contributions are much appreciated, and if you know another query that should be implemented on this package, follow these steps!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GPL-3.0 License. See LICENSE for more information.

Contact

RayhanADev - @RayhanADev - [email protected]

Project Link: https://github.com/RayhanADev/REPLAPI.it

Acknowledgements