1.0.6 • Published 2 years ago

cachejs-data v1.0.6

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

cache-data

Cache data in server. This data can be response from Endpoint API, array, text or others types.

Install

npm install cachejs-data

Usage

const Cache = require('cachejs-data')
const cache = new Cache({minToCache: 5})
const cacheKey = 'home-requests'

// Insert item in cache:
cache.insert(cacheKey, [req1: {results: [{id: 1, title: '...'}, {id: 2, title: '...'}]}])

// Remove item from cache:
cache.remove(cacheKey)

// Verify if exists cache key:
cache.exists(cacheKey)

// Verify if is expired:
cache.isExpired(cacheKey)

// Get from cache:
cache.get(cacheKey)

License

MIT © Piero Ribeiro

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago