![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@aadvdh/localstorage-cache
Advanced tools
A small library to add caching capabilities to localStorage.
npm install @aadvdh/localstorage-cache
import LocalStorageCache from 'localstorage-cache.js'
let ls = new LocalStorageCache();
Arguments: cacheExpiryTime - The amount of time to keep an item in the cache in seconds, standard at 3600 seconds, or 1 hour. prefix - a prefix added to every key. Standard value is "lsc"
ls.set(key,value,cacheExpiryTime);
Will automatically clean up the cache incase the maximum storage size is exceeded. returns true if succesful, false otherwise
Arguments: key - a key to retrieve the value by. Any non alphanumeric characters are stripped. value - the value to store. Can be any value cacheExpiryTime - in case you want to override the cacheExpiryTime.
ls.get(key);
returns the value if it exists and the item hasn't expired yet. Null otherwise.
Arguments: key - the key of the value to be retrieved.
ls.setBucket(bucket);
Set the bucketname to store the items in. All non alphanumeric characters are removed from the string.
Arguments: bucket - name of the bucket to use
ls.flush(expired);
Removes keys from storage without affecting all of the localStorage. If expired is set to false it will remove every key, otherwise it will only remove expired keys.
Arguments expired - Boolean value whether only expired items should be removed or all items.
ls.flushBucket(expired, bucket)
Same as flush, but will only remove from a bucket.
Arguments: expired - Boolean value whether only expired items should be removed or all items. bucket - The bucket to remove from, otherwise it will use the bucket defined within the class.
FAQs
A small package for using localstorage as a cache
The npm package @aadvdh/localstorage-cache receives a total of 0 weekly downloads. As such, @aadvdh/localstorage-cache popularity was classified as not popular.
We found that @aadvdh/localstorage-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.