Below you will find pages that utilize the taxonomy term “koa”
March 21, 2016
koa中生成器函数generator执行顺序详解
"ES6的generator http://book.apebook.org/minghe/koa-action/co/start.html\nfunction* gen() { var a = yield \u0026#39;start\u0026#39;; console.log(a); var b = yield \u0026#39;end\u0026#39;; console.log(b); return \u0026#39;over\u0026#39;; } var it = gen(); console.log(it.next()); // {value: \u0026#39;start\u0026#39;, done: false} console.log(it.next(22)); // 22 {value: \u0026#39;end\u0026#39;, done: false} console.log(it.next(333)); // 333 {value: \u0026#39;over\u0026#39;, done: true} 带有 * 的函数声明表示是一个 generator 函数,当执行 gen() 时,函数体内的代码并没有执行,而是返回了一个 generator 对象。 …"
March 10, 2016
nodejs学习资料
"修改npm包管理器的registry( registry.npmjs.org)为淘宝镜像( npm.taobao.org),参考nam config -h 相关命令\nnpm config set registry “https://registry.npm.taobao.org“ http://npm.taobao.org\n七天学会NodeJS http://nqdeng.github.io/7-days-nodejs/\nNode.js Style Guide https://github.com/dead-horse/node-style-guide\n深入Node.js的模块机制 http://www.infoq.com/cn/articles/nodejs-module-mechanism/\n学习ES6生成器(Generator) http://www.toobug.net/article/learning_es6_generator.html\nrequire() 源码解读 http://www.ruanyifeng.com/blog/2015/05/require.html …"