clay-resource-cache

2.0.3 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i clay-resource-cache

Weekly Downloads

17

Version

2.0.3

License

Apache-2.0

Unpacked Size

39.7 kB

Total Files

37

Last publish

Collaborators

  • realglobe