Socket
Book a DemoInstallSign in
Socket

typescript-entity

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-entity

Typed entity library with attribute sanitization and validation.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

typescript-entity

Typed entity library with attribute sanitization and validation.

Installation

yarn add typescript-entity

Usage

See the example User entity and the corresponding test for usage examples.

Motivation

There are various ORM libraries available for Typescript and JavaScript but all are tightly coupled with Data Access Mappers and underlying data stores.

This library provides just the low-level requirements of an entity without the concern of how data is mapped.

The specific use-case that led to it's inception was to be able to share entities between API and client applications. While an API application maps data sourced from arbitrary - and usually multiple - data stores, the client application would map data sourced from the API.

Both applications would share a common package that provides the entity definitions containing common domain and business logic while each being able to implement their own data mapping functionality, either by extending the base entities with create(), update(), etc. implementations (Active Record pattern) or with dedicated data mapper classes (Data Mapper/Repository pattern).

Keywords

typescript

FAQs

Package last updated on 22 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts