https://github.com/fwd/cache
In-Memory Caching
https://github.com/fwd/cache
api cache cache-storage inmemory-cache nodejs nodejs-framework serverless
Last synced: 3 months ago
JSON representation
In-Memory Caching
- Host: GitHub
- URL: https://github.com/fwd/cache
- Owner: fwd
- Created: 2020-08-25T17:51:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-03T01:35:05.000Z (over 2 years ago)
- Last Synced: 2025-02-15T13:37:34.565Z (3 months ago)
- Topics: api, cache, cache-storage, inmemory-cache, nodejs, nodejs-framework, serverless
- Language: JavaScript
- Homepage:
- Size: 5.78 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README

@fwd/cache 💾
> A NodeJS package to simplify in-memory caching.
## Install
```sh
npm install fwd/cache
```## Usage
```js
const cache = require('@fwd/cache')
// store something in-memory
cache('my_unique_key', 'my value')// get that something
var my_unique_key = cache('my_unique_key')console.log(my_unique_key) // my value
// you may also pass an expiration delay as a third parameter
cache('my_unique_key', 'my value', 10000) // 10 seconds in ms// wait 10 seconds
setTimeout(() => {
cache('my_unique_key') // undefined
}, 10000) // 10 seconds in ms```
## 👤 Author
**[@nano2dev](https://twitter.com/nano2dev)**
## 🤝 Contributing
Contributions, issues and feature requests are welcome! Feel free to check [issues page](https://github.com/fwd/cache/issues).
## ⭐️ Show your support
Give a star if this project helped you.
## 📝 License
MIT License (No Commercial Restrictions.)
Copyright © [@nano2dev](https://twitter.com/nano2dev).