@fwd/cache
v0.0.3
Published
A NodeJS package to simplify in-memory caching.
Downloads
4
Readme
A NodeJS package to simplify in-memory caching.
Install
npm install @fwd/cache
Usage
const cache = require('@fwd/cache')
// storage something
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
Forward Miami
- Github: @fwd
- Website: https://forward.miami
🤝 Contributing
Contributions, issues and feature requests are welcome! Feel free to check issues page.
⭐️ Show your support
Give a star if this project helped you, and help us continue maintaining this project by contributing to it or becoming a sponsor.
📝 License
Copyright © 2020 Forward Miami. This project is Apache-2.0 licensed.