Home

quick.replit 1.0.3


Quick.Replit

Discord Version Documentation Maintenance License: AGPL--3.0

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

  1. npm install quick.replit

Usage

  1. const { Database } = require("quick.replit");
  2. const db = new Database(process.env.REPLIT_DB_URL)
  3. //Set
  4. db.set("foo", "bar").then(() => console.log("ID 'foo' is saved with the value 'bar'!"));
  5. //Get
  6. db.get("foo").then(data => {
  7. console.log(data) // Logs 'bar'
  8. });
  9. //Delete
  10. db.delete("foo").then(() => console.log("ID 'foo' is deleted from the database!"));
  11. //All
  12. db.all().then(data => {
  13. console.log(data) // Logs all of the data with their key's in array form
  14. });
  15. //Add
  16. db.add("foo", 1).then(() => console.log("Added +1 to ID 'foo'!"));
  17. });
  18. //Subtract
  19. db.subtract("foo", 1).then(() => console.log("Subtracted 1 from ID 'foo'!"));
  20. });
  21. //Push
  22. await db.set("foo", ["bar"]) // -> ["bar"]
  23. await db.push("foo", "foo") // -> ["bar", "foo"]
  24. //Pull
  25. await db.pull("foo", "bar") // -> ["foo"]
  26. //startsWith
  27. db.startsWith("money", { sort: ".data" }).then(data => {
  28. console.log(data) // Logs all of the data present which starts with the ID 'money' in array form!
  29. });
  30. //Math
  31. db.math("coins", "-", 30).then(() => console.log("Subtracted 30 coins!")); // operand: /, +, *, -, "add", "plus", "subtract", "minus", "mul", "multiply", "div", "divide"
  32. //Ping
  33. await db.ping() // Returns a object which contains the write, read, delete and average latencies!
  34. //Has
  35. db.has("foo").then(data => console.log(data)) // -> true || false
  36. // 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!

Buy Me A Coffee Buy Me a Coffee at ko-fi.com

📝 License

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