npm install cocotte-devicecocotte-device
==============
express用のexpress-deviceを
Koa用のミドルウェアにforkしたものです。
デバイス名を判別しsessionに保存します。
ミドルウェアに設定することで、this.session.deviceを参照する事で
ユーザーエージェントからクライアントのデバイスタイプを取得します
``javascript
var koa = require('koa')
, app = koa()
, session = require('koa-sess')
, device = require('cocotte-device');
app.use(session());
app.use(device);
app.use(function*(next){
console.log(this.session.device);
yield next;
});
app.listen(3000);
``