https://github.com/oeo/taky-cache-loop
simple memory interval cache
https://github.com/oeo/taky-cache-loop
Last synced: 5 months ago
JSON representation
simple memory interval cache
- Host: GitHub
- URL: https://github.com/oeo/taky-cache-loop
- Owner: oeo
- Created: 2015-09-15T17:51:13.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-23T21:29:21.000Z (almost 10 years ago)
- Last Synced: 2025-03-10T21:49:56.171Z (10 months ago)
- Language: CoffeeScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# taky-cache-loop
# install
using [npm](https://npmjs.org)
```
npm i taky-cache-loop --save
```
# example
``` coffeescript
CacheLoop = require 'taky-cache-loop'
cache = new CacheLoop {
key: '5sdate'
fn: ((cb) ->
cb null, new Date().getTime()
)
interval: '5 seconds'
}
every '1s', ->
log cache.read()
###
1406767835607
1406767835607
1406767835607
1406767835607
1406767835607
1406767840608
1406767840608
1406767840608
1406767840608
1406767840608
1406767845609
1406767845609
###
```