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
263 Stars 21 Forks MIT License 108 Commits 3 Opened issues

Description

node-decorators

Services available

!
?

Need anything else?

Contributors list

# 76,197
TypeScr...
Node.js
mongoos...
Socket....
92 commits
# 556,559
Node.js
TypeScr...
mongoos...
Socket....
2 commits
# 45,954
HTML
TypeScr...
async-a...
mongoos...
1 commit
# 570,919
Node.js
TypeScr...
mongoos...
Socket....
1 commit
# 618,478
Node.js
TypeScr...
mongoos...
Socket....
1 commit
# 152,493
Angular
HTML
oauth2
mongoos...
1 commit
# 480,938
JavaScr...
TypeScr...
Node.js
mongoos...
1 commit
# 458,777
JavaScr...
homebri...
Node.js
TypeScr...
1 commit
# 517,299
Rust
Node.js
TypeScr...
mongoos...
1 commit

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.