🌿 Fresh.db
- Easy to use and fast JSON file based database.
⏬ Installation
$ npm install fresh.db
🌐 API
FreshDBOptions
name<String>
: Database name. db
folderPath<String>
: Database folder path. ./fresh.db
prettySave<Boolean>
: If its true brefore saving prettfys the data. false
prettySaveSS<Integer>
: Prettyf spacing amount. 2
disableGetSetErrors<Boolean>
: If the setting is true, it does not care about the errors that occur while putting or receiving data in the database and tries again. false
DEBUG<Boolean>
: false
FreshDB
Functions's first is argument always dataPath and it is string if first argument is exits
Example
const FreshDB = require("fresh.db");
let db = new FreshDB();
db.set("gameSettings.difficulty", "Hard");
db.set("gameSettings.playerName", "Armağan");
db.s.push(
"player.inventory",
"Gold Sword",
"Diamond Hoe",
"Hacked Sword",
"Apple",
"Beef",
"Hacked Beef"
);
db.update("player.inventory", (d) => {
return d.filter((i) => !i.toLowerCase().includes("hacked"));
});
db.get("player.inventory[1]");
db.set("player.inventory[1]", "Diamond Sword");
🔙 Updates
Update (1.0.7): new 3 shorthands.
Update (1.0.41): Fixed setDefaultOptions
.
Major Update (1.0.4): Better error handling & better readme & DEBUG option & prettySave and prettySaveSS options & now you can change default options (FreshDB.setDefaultOptions({})
) & new 2 shorthands (db.s
).
Update (1.0.30): Better handling for shorthands (db.s
).
Update (1.0.29): Now supports recursive folderPath
opening.
Update (1.0.2): Better readme.
Update (1.0.1): Fixing lots of bugs.
Update (1.0.0): First relese.
Created with ❤ by Kıraç Armğan Önal > + You are soo cool! Because you are using FreshDB! 💕💞💓