https://github.com/agenthackeryt/easy.db
https://github.com/agenthackeryt/easy.db
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/agenthackeryt/easy.db
- Owner: AgentHackerYT
- License: mit
- Created: 2022-02-21T06:14:33.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-21T07:36:55.000Z (over 4 years ago)
- Last Synced: 2025-02-08T16:45:00.023Z (over 1 year ago)
- Size: 70.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Easy.db
- A Simple Database Which Uses JSON Files to store your data
- Alternative for Quick.db
- Uses No 3rd Party Dependencies
- No Complex Sqlite3 like Tool Installations
- Easy To Transfer data
# How To Use?
- Creating A Database
```js
const { Database } = require('easy.db')
const db = new Database("path as written in fs")
// example
new Database("database.json")
```
- Add and Subtracting Values
```js
db.add('key', 10)
db.subtract(`key`, 10)
```
- Setting Values
```js
db.set('key', "hello world")
```
- Getting Values
```js
db.get('key')
```
- Pushing Values
```js
db.push(`key`, {some: "data"}) || db.push(`key`, ["some_data"])
```
- Deleting A Key
```js
db.delete('key')
```
- Clearing The Database
```js
db.clear()
//or
db.deleteAll()
```
- Check if the value exists or not
```js
db.has('key')
```
- All The Keys and Values
```js
db.all()
```
- Load And Save Data are Uses Less as the database automatically loads and save the keys and values