Skip to content

Commit

Permalink
fix: change package name to @telar/mvc
Browse files Browse the repository at this point in the history
Signed-off-by: Amir Movahedi <[email protected]>
  • Loading branch information
Qolzam committed Dec 15, 2020
1 parent 32d5dd7 commit 2571b28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Telar MVC

[![npm](https://img.shields.io/npm/v/telar-mvc.svg?style=flat-square)](https://www.npmjs.com/package/telar-mvc)
[![npm](https://img.shields.io/npm/dm/telar-mvc.svg?style=flat-square)](https://www.npmjs.com/package/telar-mvc)
[![npm](https://img.shields.io/npm/l/telar-mvc.svg?style=flat-square)](https://www.npmjs.com/package/telar-mvc)
[![npm](https://img.shields.io/npm/v/@telar/mvc.svg?style=flat-square)](https://www.npmjs.com/package/@telar/mvc)
[![npm](https://img.shields.io/npm/dm/@telar/mvc.svg?style=flat-square)](https://www.npmjs.com/package/@telar/mvc)
[![npm](https://img.shields.io/npm/l/@telar/mvc.svg?style=flat-square)](https://www.npmjs.com/package/@telar/mvc)

Lightweight powerful implementation of MVC(Model-View-Controller) for Node servers. Inspired and a fork from [inversify-controller](https://github.com/bluebirds-blue-jay/inversify-controller).

Expand All @@ -15,7 +15,7 @@ Lightweight powerful implementation of MVC(Model-View-Controller) for Node serve
1. Install prerequire packages

```sh
npm i koa @koa/router ajv reflect-metadata telar-mvc
npm i koa @koa/router ajv reflect-metadata @telar/mvc
````
2. Install IoC container
- e.g. Inversify Conainter
Expand All @@ -24,7 +24,7 @@ npm i koa @koa/router ajv reflect-metadata telar-mvc
npm i inversify
```

3. Make sure to import `reflect-metadata` before using `telar-mvc`:
3. Make sure to import `reflect-metadata` before using `@telar/mvc`:

```
import "reflect-metadata";
Expand All @@ -46,7 +46,7 @@ import "reflect-metadata";
### Creating a controller
```typescript
import { Controller, path } from 'telar-mvc';
import { Controller, path } from '@telar/mvc';
@Path('/')
class HomeController extends Controller {
Expand All @@ -59,7 +59,7 @@ class HomeController extends Controller {
The `bind()` helper correlates your app, your container and your controllers.

```typescript
import { bind, IController, Controller } from 'telar-mvc';
import { bind, IController, Controller } from '@telar/mvc';
import * as Koa from 'koa';
import { container } from './inversify.config';
import { HomeController, UserController, ProductController } from './controllers';
Expand Down Expand Up @@ -94,7 +94,7 @@ bind(app, container, [identifiers.HomeController, identifiers.UserController, id
This module encourages you to declare middlewares at the controller level (vs. at the app level). This gives you the same result as if you were using `app.use()`, but keeps everything in the same place.

```typescript
import { before, after } from 'telar-mvc';
import { before, after } from '@telar/mvc';
import { bodyParser } from 'koa-bodyparser';
import { errorHandler } from '../error-handler';

Expand Down Expand Up @@ -186,7 +186,7 @@ class UsersController extends Controller {
To make the code clean for proccessing http response, we provided some functions like `jsonResult` return json body, `contentResult` return string body, `redirectResult` redirect response. You also can return string/json type in the action function following example below.

```typescript
import { jsonResult, contentResult, redirectResult } 'telar-mvc';
import { jsonResult, contentResult, redirectResult } '@telar/mvc';

class UsersController extends Contoller {
@Post('/:id')
Expand Down Expand Up @@ -239,7 +239,7 @@ You can use decorators for your class model`(from MVC)` to validate your request
```typescript

import { ActionModel, jsonResult } 'telar-mvc';
import { ActionModel, jsonResult } '@telar/mvc';
import { MaxLength, Required } from 'ajv-class-validator';

export class User {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "telar-mvc",
"name": "@telar/mvc",
"description": "Lightweight powerful implementation of MVC(Model-View-Controller) for Node servers.",
"version": "0.0.0-development",
"license": "MIT",
Expand Down

0 comments on commit 2571b28

Please sign in to comment.