easystence is a tiny library to help you handle persistent data in a very easy. It provides you an incredible API with an incredible intuitive way to work.
It sounds pretty cool, right? Let's check it out!
⚠️ This project is under design/development. It has a lot of features that is not implemented yet. Do not use it in production code for now.
It provides you useful persistence units ready to use:
import { localStorageUnit } from "easystence";
You can also implement your own persistence unit as a breeze.
Create models:
import { createPersistence, localStorageUnit } from "easystence";
const persistence = createPersistence(localStorageUnit);
const Product = persistence("Product", {
id: Number,
name: String,
price: Number
});
Create model instances:
const apple = Product({
id: 1,
name: "Apple",
price: 50
});
Persist model instances:
await apple.save();
Search for data:
// Getting one value
const oneApple = await Product.findOne({ id: 1 });
// Getting all values
const allApples = await Product.find();
Delete data:
await oneApple.delete();
-
Very nice API;
-
Async support;
-
It works with a persistence unit interface, so you can save your data wherever you want;
-
Well known API to handle data;
-
Tiny;
MIT License