tinyjsondatabase

0.0.2 • Public • Published

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.

Links

Package Sidebar

Install

npm i tinyjsondatabase

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

3.82 kB

Total Files

3

Last publish

Collaborators

  • ismailaydinlik