Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

koa1-etag

finboxio5MIT2.2.0

ETag support for koa

koa, middleware, cache, caching, etag, file, static, sendfile

readme

koa-etag

NPM version Build status Test coverage Dependency Status License Downloads

ETag support for Koa responses using etag.

Repository pins Koa to koa@1

Installation

$ npm install koa-etag

Example

var conditional = require('koa-conditional-get');
var etag = require('koa-etag');
var koa = require('koa');
var app = koa();

// etag works together with conditional-get
app.use(conditional());
app.use(etag());

app.use(function(next){
  return function *(){
    yield next;
    this.body = 'Hello World';
  }
})

app.listen(3000);

console.log('listening on port 3000');

License

MIT

changelog

2.2.0 / 2017-03-23

  • pin to koa@1

2.1.0 / 2015-10-27

  • test: add more node versions on travis ci
  • feat: support etag options

2.0.0 / 2014-08-30

  • use etag module
  • use mz
  • remove options
  • etag signatures have changed

1.3.1 / 2014-07-22

  • change options.calculate= to options.hash=

1.3.0 / 2014-06-17

  • add options.calculate= for custom etag calculations

1.2.5 / 2014-06-17

  • fix: make sure the file is there before we stat it

1.2.4 / 2014-05-04

  • named generator function for improved debugging. Closes #7

1.2.3 / 2014-02-27

  • don't set etag if already set

1.2.2 / 2013-12-27

  • fix crc logic bug

1.2.1 / 2013-12-21

  • add travis.yml
  • update to use use new middleware signature

1.1.0 / 2013-09-14

  • add Stream with .path ETag support