# @mars-man/models

> for data models, forms and repository pattern

Latest version **1.3.15** (published 2021-11-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mars-man/models
pnpm add @mars-man/models
yarn add @mars-man/models
bun add @mars-man/models
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.15 |
| Published | 2021-11-23 |
| First published | 2021-06-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Marc Frame |
| Maintainers | marc.frame |
| Keywords | typescript |

## Links

- npm: https://www.npmjs.com/package/@mars-man/models
- Repository: https://github.com/mars-manjs/models
- Homepage: https://github.com/mars-manjs/models#readme
- Issues: https://github.com/mars-manjs/models/issues
- npm.io page: https://npm.io/package/@mars-man/models

## Dependencies (6)

- [lodash-es](https://npm.io/package/lodash-es.md) ^4.17.21
- [typescript](https://npm.io/package/typescript.md) ^4.2.4
- [class-validator](https://npm.io/package/class-validator.md) ^0.12.2
- [@mars-man/events](https://npm.io/package/@mars-man/events.md) ^1.0.3
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [class-transformer](https://npm.io/package/class-transformer.md) ^0.3.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.3.15 (latest) — 2021-11-23
- 1.3.14 — 2021-11-15
- 1.3.13 — 2021-11-10
- 1.3.12 — 2021-11-01
- 1.3.11 — 2021-11-01
- 1.3.10 — 2021-10-29
- 1.3.9 — 2021-10-28
- 1.3.8 — 2021-10-24
- 1.3.7 — 2021-10-22
- 1.3.6 — 2021-10-22
- 1.3.5 — 2021-10-22
- 1.3.4 — 2021-10-22
- 1.3.2 — 2021-10-21
- 1.3.1 — 2021-10-20
- 1.3.0 — 2021-10-16
- … 12 more at https://npm.io/package/@mars-man/models/versions

## README

![Mars Man Models Logo](./imgs/logo.png)

# Description
Data Model / Form / Repository Pattern

# Table of Contents
1. [Design Overview](#design-overview)
2. [Installation](#installation)
3. [API Documentation](<#API Documentation>)
3. [Examples](<#Examples>)

# Development
## System Requirements
- Dependencies: 
    - node: >14.15
    - npm:  >6.14
## Commands
```bash
# installation
npm i 

# tests
# run full test suite
`jest`

# run specific test suite
`jest forms.test.ts`

# run specific test 
`jest model.test.ts -t "async true"`

# build
npm run build

# publish
npm publish
```


# [Form](<./docs/Forms.md>) 
The goal of the form is 
- to use the same DTO object the server expects to validate the input
    - this requires formatting the data to/from frontend and backend data structure
- to abstract 


# [Repo](<./docs/Repos.md>)
Repos are the data sources, implemented with the repository pattern.

They can effectively be any data source (GraphQL, Firestore, Clod Storage...) but as of right now only APIRepo is implemented

# [Models](<./docs/Models.md>)
Models orchestrate the forms and repos


# [Examples](<./docs/Examples.md>)

---
_Source: https://npm.io/package/@mars-man/models · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
