Need help with node-decorators?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

serhiisol
227 Stars 16 Forks MIT License 102 Commits 2 Opened issues

Description

node-decorators

Services available

!
?

Need anything else?

Contributors list

Node Decorators

Project implements decorators for modern tools for NodeJS like ExpressJS, Socket.IO

Installation

npm install @decorators/di --save
npm install @decorators/express --save
npm install @decorators/socket --save

Example of usage

Here's example of usage with Express framework. It uses TypeScript and

@decorators/express
package
import { Response, Params, Controller, Get, attachControllers } from '@decorators/express';
import { Injectable } from '@decorators/di';

@Controller('/') @Injectable() class UsersController {

constructor(userService: UserService) {}

@Get('/users/:id') getData(@Response() res, @Params('id') id: string) { res.send(this.userService.findById(id)); } }

let app: Express = express();

attachControllers(app, [UsersController]);

app.listen(3000);

Documentation

Look at the corresponding package for instructions

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.