Skip to content

💾Tiny library to help you handle persistent data in a very easy way. [Design stage]

License

Notifications You must be signed in to change notification settings

imbrn/easystence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easystence

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();

Features:

  • 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;

License

MIT License

About

💾Tiny library to help you handle persistent data in a very easy way. [Design stage]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published