# @tsexpress-starter/typeorm

> TypeORM integration for TSExpress Starter.

Latest version **0.1.4** (published 2019-08-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tsexpress-starter/typeorm
pnpm add @tsexpress-starter/typeorm
yarn add @tsexpress-starter/typeorm
bun add @tsexpress-starter/typeorm
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2019-08-20 |
| First published | 2019-08-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.3 |
| Dependencies | 5 |
| Unpacked size | 15.6 KB |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| Author | Dukagjin Surdulli |
| Maintainers | dugajean |
| Keywords | typescript, express |

## Links

- npm: https://www.npmjs.com/package/@tsexpress-starter/typeorm
- Repository: https://github.com/dugajean/tsexpress-starter-typeorm
- Issues: https://github.com/dugajean/tsexpress-starter-typeorm/issues
- npm.io page: https://npm.io/package/@tsexpress-starter/typeorm

## Dependencies (5)

- [typeorm](https://npm.io/package/typeorm.md) ^0.2.18
- [class-validator](https://npm.io/package/class-validator.md) ^0.10.0
- [@tsexpress-starter/utils](https://npm.io/package/@tsexpress-starter/utils.md) ^0.1.8
- [@tsexpress-starter/errors](https://npm.io/package/@tsexpress-starter/errors.md) ^0.1.1
- [@tsexpress-starter/application](https://npm.io/package/@tsexpress-starter/application.md) ^0.2.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

- 0.1.4 (latest) — 2019-08-20
- 0.1.3 — 2019-08-20
- 0.1.2 — 2019-08-20
- 0.1.1 — 2019-08-20
- 0.1.0 — 2019-08-20
- 0.1.8 — 2019-08-20

## README

# TypeORM for TSExpress Starter

Using TypeORM with TSExpress starter comes with a few helper classes that may help you interacting with your database.

Two subscribers are provided with this package:

1. `InsertStatus` so that your responses return a 201 status code, indicating a new resource.
2. `EntityValidation` so when you use the [`class-validator`](https://github.com/typestack/class-validator) package in your entity, we return with a 400 status and a proper failure message.

## Getting started

First install this package, TypeORM and class-validator:

```bash
yarn add @tsexpress-starter/typeorm typeorm class-validator mysql
```

> **Note!** You must edit your `.env` file with the necessary database information.

In your `server.ts` file, add the following lines:

```javascript
// src/server.ts
// ...
import { connect } from '@tsexpress-starter/typeorm';

const app = new Application(__dirname, express());

app.beforeRoutes = () => connect(app);

app.start();
```

And you're done!

## License

TSExpress Starter is released under the [the MIT License](LICENSE).

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