Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattythedev01/easydatadb
A quick and easy way to store data!
https://github.com/mattythedev01/easydatadb
data database discord-bot discord-js discord-ts discordbot discordjs discordts npm npm-package package quick-db quickdb
Last synced: 6 days ago
JSON representation
A quick and easy way to store data!
- Host: GitHub
- URL: https://github.com/mattythedev01/easydatadb
- Owner: mattythedev01
- Created: 2024-10-13T05:45:29.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-15T18:17:15.000Z (4 months ago)
- Last Synced: 2024-12-04T15:47:52.568Z (2 months ago)
- Topics: data, database, discord-bot, discord-js, discord-ts, discordbot, discordjs, discordts, npm, npm-package, package, quick-db, quickdb
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@mattythedev01/easydatadb
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @mattythedev01/easydatadb Documentation
## Overview
"@mattythedev01/easydatadb", is a easy way to store data for your discord bot or any other projects outside of discord. It'll make a json folder & file in your current directory, and those files will store the data you input (Mainly used for discord bots).
## Features
- Works with the Discord Latest API Version
- Simple and intuitive API
- Automatic data persistence
- Timestamp tracking for each entry
- Support for various data types (strings, numbers, arrays, objects)
- File-based storage for easy backup and portability## Installation
`npm install @mattythedev01/easydatadb`
## Example Usage
```js
// Example usage of easydatadb// Import the EasyDataDB package
const EasyDataDB = require("@mattythedev01/easydatadb");// Create an instance of EasyDataDB
const db = new EasyDataDB("json/mydatabase.json");// Set some data
db.set("username", "mattythedev01");
db.setUserData("user123", "age", 30);
db.setGuildData("guild456", "name", "My Guild");// Get data
const username = db.get("username");
const userAge = db.getUserData("user123", "age");
const guildName = db.getGuildData("guild456", "name");console.log(`Username: ${username}`); // Output: Username: mattythedev01
console.log(`User Age: ${userAge}`); // Output: User Age: 30
console.log(`Guild Name: ${guildName}`); // Output: Guild Name: My Guild// Check if a key exists
const hasUser = db.has("username"); // true// Delete a key
db.delete("username");// Clear all data
db.clear();
```