Skip to content

fwd/cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cover

@fwd/cache 💾

A NodeJS package to simplify in-memory caching.

Install

npm install fwd/cache

Usage

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

🤝 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.

📝 License

MIT License (No Commercial Restrictions.)

Copyright © @nano2dev.