0.0.2 • Published 1 year ago

tinyjsondatabase v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Tiny Json Database

This is tinyjsondatabase. Its very simple database for your projects.

Functions

FunctionTypeDescription
setPath(path)stringSets database path.
setLogging(bool)boolEnables or disables logging.
set(data, value)stringSets data.
get(data)stringGets data.
delete(data)stringDeletes data.
check(data)stringChecks data.

Example Code

const db = require("tinyjsondatabase");

// Set database path
db.setPath("database.json")

// Enable logging
db.setLogging(true)

// Set "Hello" to "World!"
db.set("Hello", "World!")

// Get "Hello" from database
db.get("Hello") // returns "World!"

// Delete "Hello" from database
db.delete("Hello")

// Check "Hello" from database
db.check("Hello") // returns false because we deleted it.

Example Console

-- CREATING FILE
SUCCESS! File created automatically. || SUCCESS! File found.

-- IF LOGGING IS TRUE
SUCCESS! data set to value.
ERROR! data not found in database.
SUCCESS! data removed from database.

Links