da

decorator-aop

Javascript AOP with ES7 decorators

Showing:

Popularity

Downloads/wk

1

GitHub Stars

3

Maintenance

Last Commit

6yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

1.1KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

decorator-aop

Build Status

Javascript aspect orientated programming with ES7 decorators.

Installation

npm install decorator-aop

Usage

Assign the class to the aspect.

@Aspect.target(Example)
class ExampleAspect extends Aspect {
}

Join points

Use the following decorators to register join points on the aspect.

Before

@Aspect.before('myMethod')
doBeforeMyMethod(target, args) {
  console.log('executed before myMethod is called');
}

After

@Aspect.after('myMethod')
doAfterMyMethod(target, args) {
  console.log('executed after myMethod is called');
}

Intercept

@Aspect.intercept('myMethod')
doInterceptMyMethod(target, args, proceed) {
  console.log('intercept the execution of myMethod');
  return proceed.apply(target, args);
}

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100