pTimeout:https:github.comsindresorhusp timeout的Deno端口 源码
P(romise)超时 在指定的时间后使promise超时 用法 import pTimeout from 'https://deno.land/x/p_timeout@1.0.0/mod.ts const delayedPromise = new Promise ( resolve => setTimeout ( resolve , 500 ) ) pTimeout ( delayedPromise , 50 ) . then ( ( ) => 'foo' ) //=> [TimeoutError: Promise timed out after 50 milliseconds] API
用户评论