4.0.9 • Published 3 years ago
mojo.db v4.0.9
Mojo.db
npm install mojo.db
How to use?
Typescript
You can now use the module for typescript too.
NodeJS
const db = require('mojo.db');
db.backup('mybackup.json');
db.set("mojo", "a") // Set a data
db.push("hello", "world") // Pushes to array
db.fetchAll() // Fetches all
console.log(db.fetch("mojo")) // Output --> a
console.log(db.get("mojo")) // Output --> a
db.delete("data") // Deletes the data
db.deleteValEach("deletes") // Deletes all data that have the parameter
db.includes("mojo") // Returns all data includes the parameter
db.add("mojonumber", 5) // Adds 5 more
db.substract("mojonumber", 2) // Substracts 2
db.substr("mojonumber", 1) // Substracts 1
console.log(db.fetch("mojonumber")) // Output --> 2
db.clearDB() // clears database
db.arrayHas("mustbeanarray", "thevalue") // Returns true false
db.arrayDeleteVal("arrayname", "thingtodelete") // Deletes something from array
db.backupLoad('mybackup.json') // Loads your backup file
db.find(mojo = mojo < 100) // Returns the first value it finds [0]
4.0.9
3 years ago