【文件属性】:
文件名称:co-ware:受 Ware 启发,通过 co 使用生成器轻松创建自己的中间件层
文件大小:6KB
文件格式:ZIP
更新时间:2021-06-28 10:12:08
JavaScript
共件
受启发,通过使用生成器轻松创建您自己的中间件层。
例子
var ware = require ( '..' ) ;
var w = ware ( )
. use ( function * ( next ) {
this . x = 'hello' ;
yield next ;
} )
. use ( function * ( next ) {
this . y = 'world' ;
yield next ;
} )
. use ( function * ( next ) {
yield next ;
} ) ;
w . run ( { } , { } , function * ( ) {
console . log ( this . x , this . y ) ;
} ) ;
打印输入的参数。
var
【文件预览】:
co-ware-master
----.travis.yml(38B)
----index.js(2KB)
----package.json(570B)
----test()
--------index.js(4KB)
----LICENSE(1KB)
----examples()
--------input.js(147B)
--------error.js(327B)
--------app.js(299B)
----.gitignore(42B)
----Makefile(297B)
----README.md(2KB)