0.0.1 • Published 5 years ago

@zcorky/koa-cache-hits v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

koa-cache-hits

NPM version Coverage Status Dependencies Build Status license issues

Deep Diff & Patch in js, maybe data visition timeline json data is common for use. Diff => CREATE / UPDATE / DELETE / UNCHANGE Data. Patch => Immutable Philosophy Data.

Install

$ npm install @zcorky/koa-cache-hits

Usage

// See more in test
import cache from '@zcorky/koa-cache-hits';

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