Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@aws-amplify/cache
Advanced tools
@aws-amplify/cache is a part of the AWS Amplify library that provides a simple caching mechanism for storing and retrieving data in a web application. It is designed to work seamlessly with other AWS Amplify services and can be used to cache data locally to improve performance and reduce the number of network requests.
Setting a Cache Item
This feature allows you to set a cache item with a specified key and value. The optional `expires` parameter sets the expiration time in seconds.
const { Cache } = require('@aws-amplify/cache');
Cache.setItem('key', 'value', { expires: 3600 });
Getting a Cache Item
This feature allows you to retrieve a cached item using its key. If the item exists and has not expired, it will be returned.
const { Cache } = require('@aws-amplify/cache');
const value = Cache.getItem('key');
console.log(value);
Removing a Cache Item
This feature allows you to remove a cached item using its key. This is useful for clearing specific items from the cache.
const { Cache } = require('@aws-amplify/cache');
Cache.removeItem('key');
Clearing the Cache
This feature allows you to clear all items from the cache. This is useful for resetting the cache state.
const { Cache } = require('@aws-amplify/cache');
Cache.clear();
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 provides similar caching functionalities but is more focused on offline storage and supports a wider range of storage backends.
idb-keyval is a small library that provides a simple key-value store backed by IndexedDB. It offers similar caching capabilities but is more lightweight and focused solely on IndexedDB as the storage backend.
store2 is a versatile library for all types of storage (localStorage, sessionStorage, etc.) with a straightforward API. It provides similar caching functionalities and supports multiple storage backends, making it a more flexible option.
FAQs
Cache category of aws-amplify
The npm package @aws-amplify/cache receives a total of 0 weekly downloads. As such, @aws-amplify/cache popularity was classified as not popular.
We found that @aws-amplify/cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.