0.0.6 • Published 2 years ago

catliondb v0.0.6

Weekly downloads
-
License
(MIT OR Apache-2....
Repository
github
Last release
2 years ago

CatlionDB

Written by CatLion (Alexa)

CatlionDB is a customizable JSON database engine made to be easy to use. CatlionDB Features at a glance:

  • Internel DB option
  • Ability to destroy databases
  • Ability to change database file path
  • Colored console text :o

Documentation:

Code Sample

const CatlionDB = require("CatLionDB")
const DB = new CatlionDB.JSONDB("./Database.json");

DB.value = {"Key1":"Value1"}
DB.value["ExampleArray"] = [{"Name":"Alexa"}, {"Favorite Color":"Pink"}]
DB.write().then(Result => {
    console.log(Result)
}).catch(Error => {
    console.log(Error)
})

Functions

Initalize Database

new CatlionDB.JSONDB(file,[options]);

  • file Path where the database JSON file is located or will be created.
  • options Json object containing options listed below.
    • DEBUG_INFO Enable or disable extra info in console.
    • INTERNAL_DB Enable internal database. Database will be stored in CatlionDB's node_modules folder.

Set database Value

#value = [Json Object]

  • Json Object The data to be written to database. This is a regular JSON Object so you can use all the supported methods of JSON manipulation on it.

Write to database

#write()

  • Retrurns a promise which resolves on successful write and rejects on error. Details are always returned in the resolve/reject.

Destroy Database

#destroy()

  • Retrurns a promise which resolves on successful destruction and rejects on error. Details are always returned in the resolve/reject. You can create the database again with #setFile()

Set database file

#setFile(path, [options])

  • Retrurns a promise which resolves on successful set and rejects on error. Details are always returned in the resolve/reject.
  • file Path where the database JSON file is located or will be created.
  • options This option is INTERNAL_DB. Weather to create the database internally or not Setting this value will set the value the same way it would be set when you first ilitalize the database. You will need to unset it to turn it off.

##Please report any bugs on github. Thanks. ###Suggestions are also apritiated.

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago