clay-resource-cache
Cache handler for clay-resources
Last updated 3 months ago by realglobe .
Apache-2.0 · Repository · Bugs · Original npm · Tarball
$ cnpm install clay-resource-cache 
SYNC missed versions from official npm registry.

clay-resource-cache

Build Status npm Version JS Standard

Cache handler for clay-resources

Installation

$ npm install clay-resource-cache --save

Usage

'use strict'

const clayResourceCache = require('clay-resource-cache')
const clayEntity = require('clay-entity')

{
  const cache = clayResourceCache({
    max: 1000,
    maxAge: 1000 * 60 * 60
  })

  const entity01 = clayEntity({
    name: 'The entity 01'
  })

  cache.store(entity01)

  const cached = cache.get(entity01.id)
  console.log(cached) // Get cached entity
}

API Guide

License

This software is released under the Apache-2.0 License.

Links

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 10
Dependencies (1)
Dev Dependencies (18)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |