
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
@algolia/cache-browser-local-storage
Advanced tools
Promise-based cache library for browser using local storage.
@algolia/cache-browser-local-storage is an npm package that provides a caching mechanism using the browser's local storage. It is designed to store and retrieve data efficiently, making it useful for applications that require persistent client-side caching.
Set Cache
This feature allows you to set a value in the local storage cache with an optional expiration time. The code sample demonstrates how to set a key-value pair in the cache.
const { createBrowserLocalStorageCache } = require('@algolia/cache-browser-local-storage');
const cache = createBrowserLocalStorageCache();
cache.set('key', 'value', { expiresIn: 3600 }).then(() => {
console.log('Value set in cache');
});
Get Cache
This feature allows you to retrieve a value from the local storage cache using a key. The code sample demonstrates how to get a value from the cache.
const { createBrowserLocalStorageCache } = require('@algolia/cache-browser-local-storage');
const cache = createBrowserLocalStorageCache();
cache.get('key').then(value => {
console.log('Cached value:', value);
});
Delete Cache
This feature allows you to delete a value from the local storage cache using a key. The code sample demonstrates how to delete a key-value pair from the cache.
const { createBrowserLocalStorageCache } = require('@algolia/cache-browser-local-storage');
const cache = createBrowserLocalStorageCache();
cache.delete('key').then(() => {
console.log('Value deleted from cache');
});
localforage is a JavaScript library that improves the offline experience of your web app by using asynchronous storage (IndexedDB or WebSQL) with a simple, localStorage-like API. It offers more storage capacity and better performance compared to @algolia/cache-browser-local-storage.
idb-keyval is a small library that provides a simple key-value store backed by IndexedDB. It is lightweight and offers a promise-based API for storing and retrieving data, making it a good alternative to @algolia/cache-browser-local-storage for more complex storage needs.
store.js is a simple and lightweight library for cross-browser storage. It automatically falls back to the best available storage mechanism (localStorage, IndexedDB, WebSQL) and provides a straightforward API for storing and retrieving data. It is similar to @algolia/cache-browser-local-storage but offers more flexibility in terms of storage options.
FAQs
Promise-based cache library for browser using local storage.
The npm package @algolia/cache-browser-local-storage receives a total of 0 weekly downloads. As such, @algolia/cache-browser-local-storage popularity was classified as not popular.
We found that @algolia/cache-browser-local-storage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.