Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-amplify/cache

Package Overview
Dependencies
Maintainers
10
Versions
1545
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-amplify/cache

Cache category of aws-amplify

  • 5.1.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
367K
decreased by-12%
Maintainers
10
Weekly downloads
 
Created

What is @aws-amplify/cache?

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

What are @aws-amplify/cache's main functionalities?

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();

Other packages similar to @aws-amplify/cache

FAQs

Package last updated on 06 Nov 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc