Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/broucz/koa-async-conditional-get
https://github.com/broucz/koa-async-conditional-get
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/broucz/koa-async-conditional-get
- Owner: broucz
- License: mit
- Created: 2015-10-24T11:04:49.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-24T11:35:11.000Z (about 9 years ago)
- Last Synced: 2023-03-21T02:39:09.668Z (almost 2 years ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Koa Async Conditional Get
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![David deps][david-image]][david-url]
[![npm download][download-image]][download-url]+/- the async version of [koa-conditional-get](https://github.com/koajs/conditional-get).
:bulb:**This middleware is designed for [Koa](https://github.com/koajs/koa) v2.x.x and use [Babel](https://babeljs.io/) 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
```js
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](LICENSE)
[npm-image]: https://img.shields.io/npm/v/koa-async-conditional-get.svg?style=flat-square
[npm-url]: https://npmjs.org/package/koa-async-conditional-get
[travis-image]:https://img.shields.io/travis/broucz/koa-async-conditional-get.svg?style=flat-square
[travis-url]: https://travis-ci.org/broucz/koa-async-conditional-get
[coveralls-image]: https://img.shields.io/coveralls/broucz/koa-async-conditional-get.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/broucz/koa-async-conditional-get?branch=master
[david-image]: https://img.shields.io/david/broucz/koa-async-conditional-get.svg?style=flat-square
[david-url]: https://david-dm.org/broucz/koa-async-conditional-get
[download-image]: https://img.shields.io/npm/dm/koa-async-conditional-get.svg?style=flat-square
[download-url]: https://npmjs.org/package/koa-async-conditional-get