koa-async-conditional-get

Async conditional get support for Koa responses

Usage no npm install needed!

<script type="module">
  import koaAsyncConditionalGet from 'https://cdn.skypack.dev/koa-async-conditional-get';
</script>

README

Koa Async Conditional Get

NPM version build status Test coverage David deps npm download

+/- the async version of koa-conditional-get.

:bulb:This middleware is designed for Koa v2.x.x and use Babel for ES5 compatibility.

:wrench:This middleware is a work-in-progress. Feedback / PR are welcome and encouraged. If you'd like to collaborate on this project, let me know.

Installation

$ npm install --save koa-async-conditional-get

Usage

import Koa from 'koa';
import conditionalGet from 'koa-async-conditional-get';
import eTag from 'koa-async-etag';

const app = new Koa();

app.use(conditionalGet);
app.use(eTag);

app.use(async (ctx, next) => {
  await next();
  ctx.body = 'Hello World';
});

app.listen(3000);

License

MIT