You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

daniel.db

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

daniel.db

An easy to use package that makes database with JSON.

3.0.3
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

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!

Keywords

daniel.db

FAQs

Package last updated on 07 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts