1.0.3 ā€¢ Published 3 years ago

quick.replit v1.0.3

Weekly downloads
-
License
AGPL-3.0
Repository
github
Last release
3 years ago

What is Quick.Replit?

A quick and easy wraper to interact with the replit database!

Features

  • šŸ§‘ Beginner friendly
  • šŸŽ‰ Easy to use
  • šŸ“¦ Very similar to quick.db
  • šŸš€ Import & export support
  • šŸ”‘ Key value based
  • āœØ Simple
  • āš™ļø Asynchronous
  • šŸ’„ Events: ready, error, debug
  • and much more!

šŸ“š Documentation

ā” Support

šŸ“‚ NPM

Install

npm install quick.replit

Usage

const { Database } = require("quick.replit");
const db = new Database(process.env.REPLIT_DB_URL)

//Set
db.set("foo", "bar").then(() => console.log("ID 'foo' is saved with the value 'bar'!"));

//Get
db.get("foo").then(data => {
  console.log(data) // Logs 'bar'
});

//Delete
db.delete("foo").then(() => console.log("ID 'foo' is deleted from the database!"));

//All
db.all().then(data => {
  console.log(data) // Logs all of the data with their key's in array form
});

//Add
db.add("foo", 1).then(() => console.log("Added +1 to ID 'foo'!"));
});

//Subtract
db.subtract("foo", 1).then(() => console.log("Subtracted 1 from ID 'foo'!"));
});

//Push
await db.set("foo", ["bar"]) // -> ["bar"]
await db.push("foo", "foo") // -> ["bar", "foo"]

//Pull
await db.pull("foo", "bar") // -> ["foo"]

//startsWith
db.startsWith("money", { sort: ".data" }).then(data => {
  console.log(data) // Logs all of the data present which starts with the ID 'money' in array form!
});

//Math
db.math("coins", "-", 30).then(() => console.log("Subtracted 30 coins!")); // operand: /, +, *, -, "add", "plus", "subtract", "minus", "mul", "multiply", "div", "divide"

//Ping
await db.ping() // Returns a object which contains the write, read, delete and average latencies!

//Has
db.has("foo").then(data => console.log(data)) // -> true || false

// Even more methods and events are listed in our documentation! Make sure to check them out at https://quickreplit.js.org

Author

šŸ‘¤ Lebyy

šŸ¤ Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ā­ļø if this project helped you!

šŸ“ License

Copyright Ā© 2021 Lebyy. This project is AGPL--3.0 licensed.