https://github.com/pajaydev/instore-cache
https://github.com/pajaydev/instore-cache
cache cache-token expirable expirable-cache memory-cache
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pajaydev/instore-cache
- Owner: pajaydev
- Created: 2019-11-25T20:30:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T20:54:11.000Z (almost 4 years ago)
- Last Synced: 2025-02-20T19:45:34.214Z (11 months ago)
- Topics: cache, cache-token, expirable, expirable-cache, memory-cache
- Language: JavaScript
- Size: 147 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# instore-cache
node module to cache instore.
- - -
### Install.
```sh
npm install instore-cache
# yarn
yarn add instore-cache
```
### Looking to cache access token in your application ?.
You can use `expirable-cache` which caches until the time exceeds the expiry time.
```javascript
const { expirableCache } = require('instore-cache');
const expirableCache = new ExpirableCache(options);
expirableCache.set('SAMPLE_KEY_EXPIRY', "121241323qweerttyysdf", 10);
expirableCache.get('SAMPLE_KEY_EXPIRY');
```
### options
```json
{
"expireTime":5000, // expiry time above which the record will be removed.
"callback": "any function to call when the time exceeds expiry time"
}
```
### Features
* you can specify the expiration time and provide the callback which calls after time has been expired.