{"versions":{"0.0.7":{"name":"extend-promise","version":"0.0.7","description":"基于promise扩展一些常用方法","main":"index.js","scripts":{"test":"gulp test"},"repository":{"type":"git","url":"git+https://github.com/cnwhy/extend-promise.git"},"keywords":["promise"],"author":{"name":"cnwhy","email":"w.why@163.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/cnwhy/extend-promise/issues"},"homepage":"https://github.com/cnwhy/extend-promise#readme","devDependencies":{"easy-promise":"^0.1.0","gulp":"^3.9.1","gulp-browserify":"^0.5.1","gulp-header":"^1.8.8","gulp-istanbul":"^1.1.1","gulp-mocha":"^3.0.1","gulp-rename":"^1.2.2","gulp-uglify":"^2.0.0","istanbul":"^0.4.5","mocha":"^3.2.0"},"gitHead":"cbb3bcc526c85e053f9c8e471c233b2e1f84b439","_id":"extend-promise@0.0.7","_npmVersion":"6.2.0","_nodeVersion":"8.9.0","_npmUser":{"name":"anonymous","email":"w.why@163.com"},"dist":{"shasum":"037388c36f25e5f8ebc0fe38100b9e2ce7be3911","size":13353,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/extend-promise/-/extend-promise-0.0.7.tgz","integrity":"sha512-FLka6uzfpK6aPX0CYwb+wiWd6D/2W4Hg2GOD6j0QHAA/l6GCBUQ8MoWaFkvxyJiMpk92XeIgHgTLAsfcoZiIYg=="},"maintainers":[{"name":"anonymous","email":"w.why@163.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/extend-promise_0.0.7_1533888229300_0.2390312887852466"},"_hasShrinkwrap":false,"publish_time":1533888229403,"_cnpm_publish_time":1533888229403,"_cnpmcore_publish_time":"2021-12-17T04:23:35.209Z","contributors":[]},"0.0.6":{"name":"extend-promise","version":"0.0.6","description":"基于promise扩展一些常用方法","main":"index.js","scripts":{"test":"gulp test"},"repository":{"type":"git","url":"git+https://github.com/cnwhy/extend-promise.git"},"keywords":["promise"],"author":{"name":"cnwhy","email":"w.why@163.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/cnwhy/extend-promise/issues"},"homepage":"https://github.com/cnwhy/extend-promise#readme","devDependencies":{"easy-promise":"0.0.3","gulp":"^3.9.1","gulp-browserify":"^0.5.1","gulp-header":"^1.8.8","gulp-istanbul":"^1.1.1","gulp-mocha":"^3.0.1","gulp-rename":"^1.2.2","gulp-uglify":"^2.0.0","istanbul":"^0.4.5","mocha":"^3.2.0"},"dependencies":{},"gitHead":"9feb72e0b9b3352d55feeb8b1ef3e8c8dd03fcf9","_id":"extend-promise@0.0.6","_shasum":"0308e3fbe419a0530b928e4edb1c66fbf9c808e4","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"anonymous","email":"w.why@163.com"},"dist":{"shasum":"0308e3fbe419a0530b928e4edb1c66fbf9c808e4","size":14503,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/extend-promise/-/extend-promise-0.0.6.tgz","integrity":"sha512-xgZ8KKaznEfbtjufPVGg+agCLh3r8dpC+o/8MYTasu/bkeW2CahVp6fZIM5847+zM5dH/lcmPZlxBJbYslssDA=="},"maintainers":[{"name":"anonymous","email":"w.why@163.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/extend-promise-0.0.6.tgz_1486309441823_0.8617021881509572"},"directories":{},"publish_time":1486309442055,"_hasShrinkwrap":false,"_cnpm_publish_time":1486309442055,"_cnpmcore_publish_time":"2021-12-17T04:23:35.405Z","contributors":[]},"0.0.5":{"name":"extend-promise","version":"0.0.5","description":"基于promise扩展一些常用方法","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/cnwhy/extend-promise.git"},"keywords":["promise"],"author":{"name":"cnwhy","email":"w.why@163.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/cnwhy/extend-promise/issues"},"homepage":"https://github.com/cnwhy/extend-promise#readme","devDependencies":{"gulp":"^3.9.1","gulp-browserify":"^0.5.1","gulp-header":"^1.8.8","gulp-mocha":"^3.0.1","gulp-rename":"^1.2.2","gulp-uglify":"^2.0.0","istanbul":"^0.4.5","mocha":"^3.2.0","easy-promise":"0.0.3"},"dependencies":{},"gitHead":"89f1036d3b1af9b6c2d82a4974154c189f4700f9","_id":"extend-promise@0.0.5","_shasum":"b4cc92448b3c692e8bb4c68c4f6d711b7db17d95","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"anonymous","email":"w.why@163.com"},"dist":{"shasum":"b4cc92448b3c692e8bb4c68c4f6d711b7db17d95","size":11079,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/extend-promise/-/extend-promise-0.0.5.tgz","integrity":"sha512-P09NFWpvsReABuc2ZRPcjS1DPiQpkiCtNIK9MN/tgnAo73VlJY2qoZGe9CKGgekVQnEu0TRB3ERvgmJuZITlyA=="},"maintainers":[{"name":"anonymous","email":"w.why@163.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/extend-promise-0.0.5.tgz_1482941732809_0.5786518545355648"},"directories":{},"publish_time":1482941733050,"_hasShrinkwrap":false,"_cnpm_publish_time":1482941733050,"_cnpmcore_publish_time":"2021-12-17T04:23:35.602Z","contributors":[]},"0.0.2":{"name":"extend-promise","version":"0.0.2","description":"基于promise扩展一些常用方法","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/cnwhy/extend-promise.git"},"keywords":["promise"],"author":{"name":"cnwhy","email":"w.why@163.com"},"license":"BSD","bugs":{"url":"https://github.com/cnwhy/extend-promise/issues"},"homepage":"https://github.com/cnwhy/extend-promise#readme","devDependencies":{"gulp":"^3.9.1","gulp-browserify":"^0.5.1","gulp-header":"^1.8.8","gulp-mocha":"^3.0.1","gulp-rename":"^1.2.2","gulp-uglify":"^2.0.0","istanbul":"^0.4.5","mocha":"^3.2.0"},"dependencies":{"easy-promise":"0.0.1"},"gitHead":"b7f4a76f0bf748fbd7c3ac7aedcb46b59d341cc0","_id":"extend-promise@0.0.2","_shasum":"da48a803321cc9ca473a06a0491d80cb8787e2f5","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"anonymous","email":"w.why@163.com"},"dist":{"shasum":"da48a803321cc9ca473a06a0491d80cb8787e2f5","size":10166,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/extend-promise/-/extend-promise-0.0.2.tgz","integrity":"sha512-vNIdhEA3LttYns22+KFK4QQFap1r3JaLbRxsa74LEcBjlamnk3NP/AyLa56cNEZgun6JwNsQrc3Nuiglh1To2A=="},"maintainers":[{"name":"anonymous","email":"w.why@163.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/extend-promise-0.0.2.tgz_1481858427930_0.3750961972400546"},"directories":{},"publish_time":1481858429804,"_hasShrinkwrap":false,"_cnpm_publish_time":1481858429804,"_cnpmcore_publish_time":"2021-12-17T04:23:35.852Z","contributors":[]}},"dist-tags":{"latest":"0.0.7"},"name":"extend-promise","time":{"created":"2022-01-26T21:58:12.456Z","modified":"2022-01-26T21:58:12.456Z","0.0.7":"2018-08-10T08:03:49.403Z","0.0.6":"2017-02-05T15:44:02.055Z","0.0.5":"2016-12-28T16:15:33.050Z","0.0.2":"2016-12-16T03:20:29.804Z","0.0.3":"2016-12-27T07:54:19.964Z","0.0.4":"2016-12-27T08:08:02.742Z"},"readme":"# extend-promise\n基于promise扩展一些常用方法\n\n##类扩展\n```\nvar ep = require(\"extend-promise\");\nvar P = ep.extendClass(Promise,{});\n//ep.extendClass(Promise) 不传第二个参数则扩展到Promise上.\n\ndefer P.defer() //return deferrer Object \n//defer.promise //Pormise对像\n//defer.resolve(value) //解决\n//defer.reject(err)  //拒绝\n\n//返回promise\nP.resolve(value) \nP.reject(obj)       \nP.all(PromiseArray)\nP.allMap(PromiseArray/map)\nP.map(array,mapfun,options) //遍历执行, options.concurrency 可配置并发,\nP.any(PromiseArray) //返回最先改变状态的Promise状态\nP.delay(time,value) //延迟指定时间 \nP.some(PromiseArray,count) //获取最快解决Promise值;\n\n//CPS函数相关\nP.nfcall(fun,...arg) //转换CPS函数\nP.nfapply(fun,[arg]) //转换CPS函数\n\n//返回function\nvar newfn = P.denodeify(fun) //封装CPS函数\n\n```\n\nPromise原型扩展:\n```\nvar ep = require(\"extend-promise\");\nvar Promise = require(\"easy-promise\"); //建议扩展原生Promise,可以扩展第三方Promise实现\nep.extendPrototype(Promise);\n\n//返回promise\npromise = Promise.resolve(1);\n\n\n//promise 扩展后如下\n.then({resolveFun},{rejectFun}) \n.catch({rejectFun}) \n.catchOf({errType},{rejectFun}) //与catch不同的是 reject理由如果与errType相等/ instanceof 为 true时 才交由`rejectFun`处理,否则继续传递.\n.error({rejectFun}) //为.catchOf(Error,{rejectFun})的语法糖\n.finali({function}) \n.done({resolveFun},{rejectFun}) //同then,但不再返回promise,未解决的错会值接抛出\n\n```","users":{}}