@mapreedev/entity
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

@mapreedev/entity

Usage

import { BaseEntity } from "@mapreedev/entity";

type IExampleEntityCache = {
	username: string;
	id: string;
	hasPassword?: boolean;
}

type IExampleEntityDatabase = {
	username: string;
	id: string;
	password?: string;
}

const exampleEntity = new BaseEntity<IExampleEntityCache,IExampleEntityDatabase>({
	processor({ password, ...entity }){
		return{
			hasPassword: !!password,
			...entity,
		}
	}
})

// Now just use the entity with the methods provided

Rework

  • [ ] ACID
  • [ ] Prisma like methods
  • [ ] CRUD on Indexes
  • [ ] Custom errors
  • [ ] Optional database repository too
  • [ ] L3 Constructor for configure

Readme

Keywords

Package Sidebar

Install

npm i @mapreedev/entity

Weekly Downloads

3

Version

1.2.2

License

ISC

Unpacked Size

56.4 kB

Total Files

9

Last publish

Collaborators

  • mapree