Skip to content

nothing unusual, just a multifunctional local database.

Notifications You must be signed in to change notification settings

objectmap/nothing.db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

.

Nothing.db

Nothing unusual, just a multifunctional local database.

Installation

npm install nothing.db

Methods

  • .add(Name, Number)
  • .all()
  • .delete(Name)
  • .get(Name)
  • .length()
  • .push(Name, Value)
  • .resetDatabase()
  • .startsWith(Name)
  • .set(Name, Value)
  • .subtract(Name, Number)

Example code

const { Database } = require("nothing.db")

const db = new Database({
	file: "nothing.json", // (String) not required
	language: "en",  // (String) not required
	formating: true,  // (Boolean) not required
	logger: false  // (Boolean) not required
})

db.set("nothing", "is cool simple local database!")

db.on(db.evenst.Set, (data) => {
	console.log(data)
})

Usage

.add(Name, Data)

// Adds a number to the data.
<Database>.add("money", 1488)
// output: { ID: "money", data: 1488 }

.all()

// Return all data.
<Database>.all()
// output: [{ ID: "mooney", data: 1488 },{ ID: "objectmap", data: "hot developer" },{ ID: "somename", data: "somedata" }]

.delete(Name)

// Delete data.
<Database>.delete("objectmap")
// output: true

.get(Name)

// Get data with data name.
<Database>.get("objectmap")
// output: hot developer

..length()

// Return size database
<Database>.length()
// output: 2

.push(Name, Data)

// Push data into Array[].
<Database>.push("users", "Steve")
// output: [{ ID: "users", data: ["Steve"] }]
<Database>.push("users", "Alex")
// output: [{ ID: "users", data: ["Steve", "Alex"] }]

.resetDatabase()

// Reset all database.js
<Database>.resetDatabase()
// output: true

.startsWith(Name)

// Returns all data starting with "Specified Name" in database
<Database>.startsWith("user.")
//output:
// [
// { ID: "user.Steve", data: 0 },
// { ID: "user.Alex", data: 1 },
// ]

.set(Name, Data)

// Set data.
<Database>.set("objectmap", "hot")
// output: { ID: "objectmap", data: "hot developer" }

.subtract(Name, Data)

// Adds a number to the data.
<Database>.subtract("money", 100)
// output: { ID: "money", data: 1388 }

Events

  • Add
  • CreateDatabase
  • Delete
  • Push
  • ResetDatabase
  • Set
  • Subtract

Supported languages

Language Code
English (default) en
Russian ru
Ukrainian ua
Arabic ar
German de

Thank you for using (or just watching) my project, rate it with a star on the github homepage! 💜

About

nothing unusual, just a multifunctional local database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published