3.0.3 • Published 2 years ago

daniel.db v3.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

An easy to use package that makes database with JSON.

How to install:

npm install daniel.db

Methods:

create()

const DanielDB = require("daniel.db")
const db = new DanielDB({ name: "main" })

add()

// Increases the current value to the key
db.add('joins', 1)

set()

// Sets the key to value
db.set(`name`, 'daniel')

get()

// Get a value from the key
db.get(`name`)

has()

// Returns if the database has the provided key
db.has(`name`)

delete()

// Deletes a key from the database
db.delete(`name`)

deleteAll()

// Deletes all the keys in the database
db.deleteAll()
// Done!

all()

// Returns an array of objects (ID, data)
db.all()

push()

// Pushes a value to the array
db.push(`name`, 'hello')

reset()

// Resets the key in the database to 0
db.reset(`joins`)

WARNING: ⚠

If you're using nodemon, please use the --ignore file to ignore all the json files, or else your project will restart every time the database getting updated.

Example:

nodemon fileName.js --ignore *.json

If do you want to run your main file, dont write the [fileName] in the command.

Need help? Contact me via Discord or Email!

2.1.2

2 years ago

2.1.1

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.6

2 years ago

2.1.5

2 years ago

2.1.8

2 years ago

2.1.7

2 years ago

2.1.0

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.3-f

3 years ago

1.0.3-e

3 years ago

1.0.3-g

3 years ago

1.0.4

3 years ago

1.0.4-a

3 years ago

1.0.4-b

3 years ago

1.0.3-d

3 years ago

1.0.3-c

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.3-b

3 years ago

1.0.3-a

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago