nest-view
TypeScript icon, indicating that this package has built-in type declarations

1.0.14 • Public • Published

Nest View

Nest view is a module created to make easy data manipulation inside an application based on NestJS.

Instalation

This module is available in npm registry.

Dependencies

The first step to use this module is create a simple application based on NestJS.

Next step: install @nestjs/swagger in your application.

Now just install the module using npm command

$ npm install nest-view

Features

  • Create views to manipulate data
  • Use view to validate data
  • Use views to make schemas to use in nestJS swagger documentation

Usage

The first step to use this module is to create a view

View example


import { PropView, View } from 'nest-view';

@View()
export class Example {
  @PropView({ type: String })
  name: string;

  @PropView({ type: Number })
  age: number;
}

Now you're able to use this view to manipulate data and use to document your request's in swagger.

Swagger documentation


import { Body, Controller, Get } from '@nestjs/common';
import { ApiBodyView } from 'nest-view';
import { Example } from './view';

@Controller()
export class AppController {
  @Get()
  @ApiBodyView(Example)
  getHello(@Body() body: Example) {
    return;
  }
}

Readme

Keywords

Package Sidebar

Install

npm i nest-view

Weekly Downloads

2

Version

1.0.14

License

MIT

Unpacked Size

40.4 kB

Total Files

51

Last publish

Collaborators

  • j0hnsons