# nnvc

> An MVC library

Latest version **1.4.2** (published 2022-10-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install nnvc
pnpm add nnvc
yarn add nnvc
bun add nnvc
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.2 |
| Published | 2022-10-13 |
| First published | 2022-08-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 35.8 KB |
| Known vulnerabilities | 0 (+18 in 1 direct dependencies) |
| Install scripts | no |
| Author | Siwakorn |
| Maintainers | cardeer |

## Links

- npm: https://www.npmjs.com/package/nnvc
- Repository: https://github.com/cardeer/nnvc
- Issues: https://github.com/cardeer/nnvc/issues
- npm.io page: https://npm.io/package/nnvc

## Dependencies (9)

- [knex](https://npm.io/package/knex.md) ^2.3.0
- [chalk](https://npm.io/package/chalk.md) 4.1.2
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.2
- [express](https://npm.io/package/express.md) ^4.18.1
- [nodemon](https://npm.io/package/nodemon.md) ^2.0.19
- [ts-node](https://npm.io/package/ts-node.md) ^10.9.1
- [liquidjs](https://npm.io/package/liquidjs.md) ^9.42.0
- [typescript](https://npm.io/package/typescript.md) ^4.8.3
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13

## Recent versions

- 1.4.2 (latest) — 2022-10-13
- 1.4.1 — 2022-10-13
- 1.4.0 — 2022-10-13
- 1.3.6 — 2022-09-21
- 1.3.4 — 2022-09-21
- 1.3.3 — 2022-09-21
- 1.3.1 — 2022-09-21
- 1.3.0 — 2022-09-21
- 1.2.6 — 2022-08-20
- 1.2.5 — 2022-08-18
- 1.2.4 — 2022-08-18
- 1.2.3 — 2022-08-16
- 1.2.2 — 2022-08-16
- 1.2.1 — 2022-08-16
- 1.2.0 — 2022-08-16
- … 12 more at https://npm.io/package/nnvc/versions

## README

This library only supports TypeScript.

---

### Installation

Using npm

```bash
npm install nnvc --save
```

Using yarn

```bash
yarn add nnvc
```

---

### Basic Usage

Add this script in your package.json

```json
{
  "dev": "nodemon --watch src --ext ts,json --exec 'ts-node src/index.ts'"
}
```

Creating a server

```ts
import { Server } from 'nnvc/server'

class ApplicationServer extends Server {
  protected port: number = 3000

  constructor() {
    super()
  }
}

const app = new ApplicationServer()
app.start()
```

Now, let's create a controller

```ts
import { IncomingHttpHeaders } from 'http'
import { Controller, Get, Status } from 'nnvc'

@Controller('/')
export class IndexController {
  @Get('/ping')
  @Status(200)
  public async ping() {
    return {
      msg: 'pong',
    }
  }
}
```

After creating a controller, you have to register it in the server

```ts
class ApplicationServer extends Server {
  protected port: number = 3000

  constructor() {
    super()

    this.register(IndexController)
  }
}
```

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