🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

aop-function

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aop-function

function aop plugin

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

aop-function

nodejs function aop plugin



 var aop = require('aop-function');
 
 //target function
 var kill = function(who,blood,callback){
    setTimeout(function(){
       console.log('kill==>',who,':',blood);
       callback();
    },500);
 }
 
 kill = aop(kill,function aop1(who,blood,next){
    console.log('this is aop1 start ')
    setTimeout(function(){
       next(null,function(nxt){
         console.log('this is aop1 end ');
         nxt();
       });
    },500);
 }
 ,function aop2(who,blood,next){
   console.log('this is aop2 start')
    setTimeout(function(){
       next(null,function(nxt){
         console.log('this is aop2 end ');
         nxt();
       });
    },500);
 }
 ,function aop3(who,blood,next){
   console.log('this is aop3 start')
    setTimeout(function(){
       next(null,function(nxt){
         console.log('this is aop3 end ');
         nxt();
       });
    },500);
 }
 );
 
 kill('bad-man',1000,function(err){
   console.log('kill finish ');
 })
 
 

Keywords

aop

FAQs

Package last updated on 03 Mar 2016

Did you know?

Socket

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.

Install

Related posts