Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koajs/koala
[SEEKING MAINTAINER] An HTTP/2 and ES6 Module-ready Koa Suite
https://github.com/koajs/koala
Last synced: 27 days ago
JSON representation
[SEEKING MAINTAINER] An HTTP/2 and ES6 Module-ready Koa Suite
- Host: GitHub
- URL: https://github.com/koajs/koala
- Owner: koajs
- License: mit
- Created: 2014-06-11T07:20:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-02-05T03:06:30.000Z (9 months ago)
- Last Synced: 2024-04-14T13:08:40.589Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 957 KB
- Stars: 319
- Watchers: 21
- Forks: 28
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-koa - koala - [SEEKING MAINTAINER] An HTTP/2 and ES6 Module-ready Koa Suite (Middleware)
- awesome-starred - koajs/koala - [SEEKING MAINTAINER] An HTTP/2 and ES6 Module-ready Koa Suite (others)
README
# Koalaα
[![Gitter chat][gitter-image]][gitter-url]
[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependency Status][david-image]][david-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]A suite of Koa utilities allowing for quicker bootstrapping,
as well as a consequential guide on how to write apps using the Koa philosophy.
Think of it as a KrakenJS for Koa.## Status
Beware! Koala is alpha software!
## Philosophy
Koa is a bare minimal framework, focusing on unopinionated core HTTP utilities.
However, this is not sufficient for most apps as a lot is not supported out of the box.
Including a bunch of dependencies in every new app you create quickly becomes annoying.The goal of Koala is to include the most used and unopinionated parts of apps
into a single framework. Many things such as body parsing, sessions, and CSRF are
included. Many other things, such as routing, is too opinionated and not included.Unlike other frameworks, Koala will __not dictate how to write business logic__.
Thanks to generators and, eventually, ES7 Async/Await, writing business logic in Koa is much easier than other frameworks,
and Koala's goal is to only make it easier.
Don't expect a single option to automatically do magic for your app.Feel free to create suggestions!
## Features and Documentation
The Koala framework adds to Koa:
- [Body Parsing](docs/body-parsing.md)
- Seamless `Expect: 100-continue` support
- Per-request body limits
- Supports JSON, urlencoded, and multipart bodies
- Supports arbitrary strings, buffers, and files as bodies
- Optional nested parameter support
- [File Serving](docs/file-serving.md)
- [Sessions](docs/sessions.md)
- Cookie-based sessions
- CSRF protection
- [Response Caching](docs/response-caching.md) - cache and serve responses using an arbitrary store
- [JSONP](docs/jsonp.md) - safe jsonp support
- [Security Headers](docs/headers.md)
- [Error Page](docs/error-page.md) - better default error page
- [Tracing](docs/tracing.md)
- [etc](docs/etc.md)
- Basic auth
- Object stream support
- Optional nested query string supported
- [FAQ](docs/faq.md)`koala(1)` will be a generator, similar to what `express(1)` is.
## Usage
Simply replace `require('koa')` with `require('koala')`.
Koala returns a `koa` app, except it includes more features.```js
const koala = require('koala');
const app = new Koala();app.use(async () => {
this.response.status = 204;
});app.listen((err) => {
if (err) {
console.error(err);
throw err;
}
console.log('Koala app listening on port %s', this.address().port);
});
```## Roadmap
Some additional features may include:
- Timeout assertion
- Server-Side Event Streams
- Rate limitingLet me know if you have any other suggestions.
[gitter-image]: https://img.shields.io/gitter/room/koajs/koala.svg?style=flat-square
[gitter-url]: https://gitter.im/koajs/koala
[npm-image]: https://img.shields.io/npm/v/koala.svg?style=flat-square
[npm-url]: https://npmjs.org/package/koala
[travis-image]: https://img.shields.io/travis/koajs/koala.svg?style=flat-square
[travis-url]: https://travis-ci.org/koajs/koala
[coveralls-image]: https://img.shields.io/coveralls/koajs/koala.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/koajs/koala?branch=master
[david-image]: http://img.shields.io/david/koajs/koala.svg?style=flat-square
[david-url]: https://david-dm.org/koajs/koala
[license-image]: http://img.shields.io/npm/l/koala.svg?style=flat-square
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/koala.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/koala