Magmadb is a package that offers a user-friendly solution for storing and accessing data in a low to medium volume environment, suitable for individuals with varying levels of expertise. The data is stored locally and persistently in json format, and the package also provides a variety of convenient features to enhance the user experience.
A MAJOR BUG HAS BEEN FIXED, MAGMADB NOW WORKS PERFECTLY!
- Persistent Storage - Data doesn't disappear through restarts
- Works out of the box - No need to set up a database server, all the data is stored locally in the same project
- Beginner Friendly - Originally created for use in tutorials or in small projects
- & more...
Installation
npm i magmadb
const MagmaDatabase = require("magmadb");
const db = new MagmaDatabase("db1");
const accounts = db.CreateCollection("accounts");
accounts.CreateData({
id: 38437838728397,
name: "Jacob",
email: "example@domain.com",
password: "password123"
});
const jacob = accounts.GetData({ id: 38437838728397 });
console.log(jacob);
const jacob = accounts.GetData({ id: 38437838728397 });
accounts.UpdateData(jacob, {
email: "example4@domain.net"
});
console.log(jacob);
accounts.CreateData({
id: 49845168798135,
name: "Walter",
email: "example2@domain.com",
password: "password123"
});
const allAccounts = accounts.GetAllData();
console.log(allAccounts);
let usersWithSamePassword = accounts.Find({ password: "password123" });
console.log(usersWithSamePassword);
const jacob = accounts.GetData({ id: 38437838728397 });
accounts.DeleteData(jacob)
console.log(accounts.GetAllData());
db.DeleteCollection(accounts);
console.log(accounts.GetAllData());