@rbarisic/local-storage-cache
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

local-storage-cache

Super simple package to cache data using local storage. It only removes outdated data when calling getCachedData and the data has expired.

// To store data
cacheData('your-key', dataYouWantToStore, expireInMilliseconds);

// To get data
getCachedData('your-key');

Original by Tomas Sjösten, forked by me (rbarisic) to include typing and module exports

Package Sidebar

Install

npm i @rbarisic/local-storage-cache

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

3.3 kB

Total Files

5

Last publish

Collaborators

  • rbarisic