【文件属性】:
文件名称:node-promise:用于node.js的ECMAScript 6 Promise对象的Polyfill
文件大小:6KB
文件格式:ZIP
更新时间:2021-05-30 14:18:36
JavaScript
node.js 的 Promise polyfill
不要使用这个:别人的更好。
Node v0.10 的 ES6 Promise 对象的 polyfill。
Node 0.11 及以上版本使用带有原生 Promise 对象的 V8 版本,不需要这个。
关于承诺:
用法
// In anticipation of native support in future Node versions
if ( typeof Promise === 'undefined' ) {
global . Promise = require ( 'promise-polyfill' ) ;
}
如果本机 Promise 对象(或作为全局添加的另一个 polyfill)已经存在,polyfill 将console.warn() 。
在浏览器中使用
如果你真的想在浏览器中使用它,你需要setIm
【文件预览】:
node-promise-master
----package.json(388B)
----LICENSE(1KB)
----README.md(1KB)
----lib()
--------promise-polyfill.js(6KB)
----test()
--------test.js(15KB)
--------runTests.js(694B)