
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
NgAspect is a little library of decorators that unlocks aspect-oriented programming features in JavaScript.
Aspect-oriented programming suggests separating cross-cutting concerns (logging, caching, monitoring, data validation, error detection and so on) from main business logic. In brief it introduces:
NgAspect provides decorators @Before and @After that allow to bind an advice to a pointcut e.g. @Before( Class/Constructor, "methodName" ).
It also exports @Pointcut decorator that points out what method can be supplied with advices.
import { Before, After, Pointcut } from "./aspect";
class Foo {
@Pointcut
bar(){
console.log( "calling bar", arguments );
}
}
class Advice {
@Before( Foo, "bar" )
preLog() {
console.log( "calling pre-log", arguments );
}
@After( Foo, "bar" )
postLog() {
console.log( "calling post-log" );
}
}
(new Foo()).bar( 1, 2, 3 );
Output:
calling pre-log 1,2,3
calling bar 1,2,3
calling post-log
The same goes for static methods
import { Before, After, Pointcut } from "./aspect";
class Foo {
@Pointcut
static bar(){
console.log( "calling bar" );
}
}
class Advice {
@Before( Foo, "bar" )
@After( Foo, "bar" )
static log() {
console.log( "log" );
}
}
Foo.bar();
@Before( Foo, "bar" )
@After( Foo, "bar" )
or
@Before([ Foo, "bar" ])
@After([ Foo, "bar" ])
@Before([
[ Foo, "bar" ],
[ Baz, "quiz" ],
])
FAQs
Decorators to unlock aspect-oriented programming experience in JavaScript
We found that ng-aspect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.