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

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

1

Version

0.0.6

License

ISC

Unpacked Size

34.2 kB

Total Files

8

Last publish

Collaborators

  • mapree