@koex/cache
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

cache

NPM version NPM quality Coverage Status Dependencies Build Status Known Vulnerabilities NPM download license issues

cache for koa extend. And you can custom auto cache db, like redis.

Install

$ npm install @koex/cache

Usage

// See more in test
import cache from '@koex/cache';

import * as Koa from 'koa';
const app = new Koa();
app.use(cache(options));
app.use(async (ctx) => {
  if (ctx.path === '/') {
    ctx.body = 'hello, world';
  } else if (ctx.path === '/json') {
    ctx.body = {
      name: 'name',
      value: 'value',
    };
  }
});

app.listen(8000, '0.0.0.0', () => {
  console.log('koa server start');
});

Related

Readme

Keywords

none

Package Sidebar

Install

npm i @koex/cache

Weekly Downloads

1

Version

0.0.8

License

MIT

Unpacked Size

8.7 kB

Total Files

5

Last publish

Collaborators

  • uniquecolesmith