Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

AsyncProxy

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

AsyncProxy

asynchronous code helper.

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

#AsyncProxy.js - 异步代码管理模块,asynchronous code helper

##举个例子:For example

var as = require('AsyncProxy')();

  fn1, fn2, fn3, fn4, //4 asynchronous function

  callback; //call this function when all the async functions finished executing;

  var total = as.ap(fn1, fn2, fn3, fn4, callback);//'total' means how many async job will complete
  
  //as.ap.apply(null, [fn1, fn2, fn3, fn4, callback]);//when the async functions's length is unknown;

##注意点:cautions

1、 var as = require('AsyncProxy')();//这样定义会并发执行异步函数,效率高 Concurrent execution the async functions

2、 var as = require('AsyncProxy')(true);//这样会依次执行异步函数,有先后依赖 Call the asynchronous functions one by one

3、 var fn1 = function(rec){setTimeout(function(){ //... do something; rec();//这里必须执行这个,表示异步返回 Tell AsyncProxy the async has complete; }, 5000);}

##如何安装:how to install

1、直接github下载, download it here

2、npm install AsyncProxy

FAQs

Package last updated on 20 Jan 2012

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc