1.1.2 • Published 9 months ago

@metamatter/nest v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Description

MetaMatter is a library for building runtime type definition generation. It is built with TypeScript and combines the concepts of Meta-Programming, to create type-safe, scalable environment for (mainly) Frontend development.

Philosophy

There are numbers of libraries for building a Node.js server-side applications. However, there is an issue when it comes to communicate between Frontend and Backend no matter which backend language we are using. Type Definitions, would be troublesome when it comes to Agile development style. Frequent updates on APIs makes it hard to develop projects in a type-safe environment.

MetaMatter aims to address this issue, by providing a lightweight, less configuration tools.

Installation

> yarn add @metamatter/core
# or
> npm install @metamatter/core

Plug and Play

If you want to use the package without any configuration. Do this.

import { MetaMatterModule } from "@metamatter/nest";

@Module({
    imports: [
        MetaMatterModule.forRoot({
            appModule: AppModule,
            globalPrefix: undefined,
        }),
    ],
})
export class AppModule {}

Send a GET request to /metamatter/api, and you can see a immediate result

> curl http://localhost:3000/metamatter/api

Usage

  • @Module()
  • @Controller()
  • @RequestBody(type)
  • @ResponseData(type?)
  • @ResponseArrayData(type?)