1.1.0 • Published 7 years ago

@decorators/co v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Node Decorators

Project implements decorators for modern tools for NodeJS like:

Installation

npm install @decorators/co --save

API

Decorators

Method
  • @Async
import { Async } from 'node-decorators/co';

let testAsyncFunc = () => {
  return new Promise(resolve => {
    setTimeout(() => {
      console.log('testAsyncFunc');
      resolve()
    }, 3000);
  });
};

class TestController {
  @Async()
  *getData() {
    console.log('code before async function');
    yield testAsyncFunc();
    console.log('code after async function');
  }
}

License

MIT

1.1.0

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago