koajs

wiki

框架

Frameworks, boilerplates, and other starter kits using Koa.

  • api-boilerplate - an API application boilerplate
  • koala - a more feature-rich version of Koa, including many middleware and utilities
  • koan - Full stack JavaScript Web development boilerplate with Koa and Angular.
  • component-boilerplate-koa - component + koa boilerplate
  • opinion - Koa, and some modules so you can just start building
  • koa-mvc - Opinionated and minimalist MVC generator
  • surface - A tiny middleware of RESTful API for koa
  • koanect - A bare minimum framework that allows your web app to run standalone or to be packaged and included in other koanect apps.
  • roo – jump-start your web app with a thin layer on top of koa to reduce initial boilerplate
  • resourced - A resource-oriented DSL for configuring koa.

中间件

Known middleware for Koa, you may want to search npm with "koa" to find more.

  • cors - CORS middleware
  • koa-slow - delay answering requests by URL RegExp, useful for debugging.
  • koa-force-ssl - Middleware for force SSL
  • cluster - clustering and error handling utility
  • polyfills - user-agent based polyfill bundle serving

安全

  • koa-helmet - security headers for koa
  • koa-ip - Ip filter middleware for koa, support whitelist and blacklist

主体解析

  • body - parse http request body
  • hal-body - parse hal+json request body
  • koa-parse-json - parse JSON request body
  • better-body - a http request parser with support for urlencoded, multipart and json bodies!
  • koa-body-parser - parse request body into context.request.body (using co-body) like the express body parser
  • koa-bodyparser - a body parser for koa, base on co-body

参数验证

速度限制

  • ratelimit - rate limiting middleware
  • better-ratelimit - support black/white lists, Retry-After header, 429 status, in-memory store.

路由和安装

  • mount - mount koa applications as middleware
  • route - uber simple routing middleware
  • routing - routing middleware
  • router - RESTful resource router
  • koa-frouter - File as path
  • rewrite - url rewriting middleware
  • trie-router - Trie-based routing
  • params - Express style params support for koa-route.
  • koa-methodoverride - HTTP method overriding middleware
  • koa-overwrite - Overwrites request.method with forms _method.
  • qs - nested query string support
  • kroute - Simple, self-contained koa routes and applications
    • koa-dispatch - Hybrid Koa router with multiple handlers and param support.
  • koa-barista - routing middleware based on the strong barista router.
  • koa-joi-router - Configurable, input and output validated routing for koa
  • koa-version - Mounting app by version to different router.

文件服务

  • send - a send file utility
  • sendfile - a barebone send file utility
  • static - static file serving middleware
  • file-server - static file serving with additional features like etag and SPDY Push support
  • static-cache - static file serving from memory
  • spa - Single page app server build upon static-cache
  • favicon - bounce favicon requests with a 404
  • koa-favi - connect.favicon like middleware default use node logo
  • koa-broccoli - a broccoli server (w/ livereload)
  • koa-combo - combine your static files at serverside and reduce number of HTTP requests in a flexible way
  • koa-watchify - Wraps a browserify or watchify instance into a koa middleware

SPDY

  • spdy-push - SPDY Push helper
  • file-server - static file serving with additional features like etag and SPDY Push support

JSON 和 JSONP 响应

  • jsonp - streamable jsonp support
  • json-filter - json response filtering to reduce traffic
  • json-mask - json response filtering to reduce traffic. Supports filtering at any depth
  • json - pretty-printed json responses
  • koa-hal - hal+json response support
  • koa-jsonapi-headers - Validate JSON-API Request Headers

压缩

  • compress - compression middleware
  • compressor - SPDY/HTTP2 compression middleware (always gzips)
  • koa-gzip - gzip support for koa responses
  • koa-minify - minify middleware for js, css, html and img.
  • koa-uglify2 - uglify middleware for js with caching

缓存

认证

对话

模板

服务

  • koa-pg - Handle your Pg database connections automatically.
  • koa-mongo - MongoDB middleware for koa, support connection pool.
  • koa-redis-pool - Redis middleware for koa, support connection pool.
  • koa-redisy koa wrapper for co-redis, which is a wrapper for node-redis
  • rethinkdbdash - RethinkDB driver with promises and a connection pool.
  • component-koa - koa middleware for component builds

CSS 预处理器

Livereload

错误报告

  • error - text, json, html error responses with swig template support
  • http-assert - assert with status codes
  • error-ejs text, json, html error responses with ejs template support

日志

Metrics

  • statsd - statsd integration
  • response-time - x-response-time header field middleware
  • koa-ping - ping and health route for app status check

i18n 和 L10n

  • koa-locale - Get locale variable from query, subdomain, accept-languages or cookie
  • koa-i18n - Lightweight simple translation middleware based on i18n-2

实用程序

Misc utilities that are useful for Koa applications. Note that co lets you yield a variety of types, so existing libraries using promises etc should work fine.

  • co-punch - Punch old libraries!
  • cofy - Cofy is a bridge connecting callback style object to sequential style in co or koa environment with one punch.
  • compose - compose several middleware into one
  • Shen - Shen is underscore for generators
  • co libraries - thunk-based libraries that work with Koa

聚合

Aggregate modules make including common suites of middleware in your application(s) easier. This mimics the convenience of Connect's bundled middleware without forcing them on people.

  • common - mount, logger, response-time, static
  • opinion - my opinion on what's needed to get started

应用

Application list using Koa.

  • cnpmjs.org - Private npm registry and web for Enterprise, base on koa, MySQL and Simple Store Service.
  • component-crawler - component.json crawler
  • DailyNode - A complete, timely aggregator of node things: blog, tutorial, video, npm, tool, framework, conf.
  • Badgelino - Very much work in progress. Fast, extensible badges server. Badges done right. Routes done right.

截屏