tinyjsondatabase
v0.0.2
Published
Tiny and easy json database.
Downloads
2
Maintainers
Readme
Tiny Json Database
This is tinyjsondatabase. Its very simple database for your projects.
Functions
| Function | Type | Description |
| :-------- | :------- | :-------------------------------- |
| setPath(path)
| string
| Sets database path. |
| setLogging(bool)
| bool
| Enables or disables logging. |
| set(data, value)
| string
| Sets data. |
| get(data)
| string
| Gets data. |
| delete(data)
| string
| Deletes data. |
| check(data)
| string
| Checks 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.