loud-rejection:使未处理的承诺拒绝大声失败,而不是默认的静默失败

时间:2021-05-26 03:27:02
【文件属性】:
文件名称:loud-rejection:使未处理的承诺拒绝大声失败,而不是默认的静默失败
文件大小:9KB
文件格式:ZIP
更新时间:2021-05-26 03:27:02
JavaScript 大声拒绝 使未处理的承诺拒绝大声失败,而不是默认的 默认情况下,如果您不.catch()附加.catch()处理函数,则它们会默默地失败。 此工具可全局跟踪未处理的拒绝。 如果在处理结束时仍未处理,它将它们记录到STDERR并以代码1退出。 在测试,CLI工具,应用程序等*内容中使用此功能,但不可在可重用模块中使用此功能。 浏览器中不需要,因为控制台中显示了未处理的拒绝。 使用,该程序包是默认行为,随后将引发未处理的拒绝。 安装 $ npm install loud-rejection 用法 const loudRejection = require ( 'loud-rejection' ) ; const promiseFunction = require ( 'promise-fn' ) ; // Install the `unhandledRejection` liste
【文件预览】:
loud-rejection-main
----fixture-custom-log.js(152B)
----index.test-d.ts(172B)
----.gitattributes(19B)
----.github()
--------funding.yml(120B)
--------security.md(179B)
--------workflows()
----register.d.ts(0B)
----register.js(30B)
----test.js(4KB)
----license(1KB)
----index.d.ts(797B)
----fixture.js(1009B)
----.npmrc(19B)
----.editorconfig(175B)
----.gitignore(35B)
----index.js(829B)
----readme.md(2KB)
----package.json(1KB)

网友评论