Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koajs/etag
ETag support for Koa responses
https://github.com/koajs/etag
Last synced: 3 days ago
JSON representation
ETag support for Koa responses
- Host: GitHub
- URL: https://github.com/koajs/etag
- Owner: koajs
- License: mit
- Created: 2013-09-14T03:34:36.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-04-10T23:00:28.000Z (over 1 year ago)
- Last Synced: 2024-10-29T15:32:22.783Z (about 1 month ago)
- Language: JavaScript
- Size: 50.8 KB
- Stars: 113
- Watchers: 4
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
- awesome-koa - etag - ETag support for Koa responses (Middleware)
- awesome-koa - koa-etag - 为Koa响应提供Etag功能。 ![](https://img.shields.io/github/stars/koajs/etag.svg?style=social&label=Star) ![](https://img.shields.io/npm/dm/koa-etag.svg?style=flat-square) (仓库 / 中间件)
README
# koa-etag
[![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]Etag support for Koa responses using [etag](https://github.com/jshttp/etag).
## Installation
```bash
# npm
$ npm install koa-etag
# yarn
$ yarn add koa-etag
```## Example
```js
const conditional = require('koa-conditional-get');
const etag = require('koa-etag');
const Koa = require('koa');
const app = new Koa();// etag works together with conditional-get
app.use(conditional());
app.use(etag());app.use(function (ctx) {
ctx.body = 'Hello World';
});app.listen(3000);
console.log('listening on port 3000');
```## License
[MIT](LICENSE)
[npm-image]: https://img.shields.io/npm/v/koa-etag.svg?style=flat-square
[npm-url]: https://npmjs.org/package/koa-etag
[github-tag]: http://img.shields.io/github/tag/koajs/etag.svg?style=flat-square
[github-url]: https://github.com/koajs/etag/tags
[travis-image]: https://img.shields.io/travis/koajs/etag.svg?style=flat-square
[travis-url]: https://travis-ci.org/koajs/etag
[coveralls-image]: https://img.shields.io/coveralls/koajs/etag.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/koajs/etag?branch=master
[david-image]: http://img.shields.io/david/koajs/etag.svg?style=flat-square
[david-url]: https://david-dm.org/koajs/etag
[license-image]: http://img.shields.io/npm/l/koa-etag.svg?style=flat-square
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/koa-etag.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/koa-etag
[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square
[gittip-url]: https://www.gittip.com/jonathanong/