Giter VIP home page Giter VIP logo

replit-query's Introduction

REPL.IT QUERY

In this repl.it API, I plan to take advantage of everything. Adapted from replya.

Quickstart

const replit = require("replit-query")();
await replit.login("username", "password");
...

Documentation

Each of these examples will require an instance of the client.

const client = require("replit-query")();

Query

This is the root of basically all applications. PARAMS query: This is what will be your query. It will be implemented like this:

{
  query
}

You may want to read up on graphQL. RETURN A return value will look something like

{
  ...
}

query

await client.query('userByUsername(username: "username"){karma}').karma;

userByUsername

await client.talk.userByUsername("username", ["karma"]).karma;

userById

await client.talk.userById(2222, ["karma"]).karma;

leaderboard

await client.talk.leaderboard(5, ["karma"])[0].karma; // top 5, the first person's karma

commentById

await client.talk.commentById(123456, ["title"]).title;

posts

await client.talk.posts(10, ["title"])[0].title; // newest post's title

login

await client.login("username", "password");
/*
=> {
  username: ...,
  email: ...,
  ...
  auth_jwt: ...,
  ...
}
*/

getLoginKey

await client.getLoginKey("username", "password"); // => 3Er%R4d3f...

Errors

They will be in the following form. replit query error: ... Note that errors are put within a .catch() block.

Credits

Special thanks to m3l0f1 to which this is adapted from replya

replit-query's People

Contributors

mrlapizgithub avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.