Socket
Socket
Sign inDemoInstall

@aws-sdk/endpoint-cache

Package Overview
Dependencies
Maintainers
5
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/endpoint-cache

[![NPM version](https://img.shields.io/npm/v/@aws-sdk/endpoint-cache/latest.svg)](https://www.npmjs.com/package/@aws-sdk/endpoint-cache) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/endpoint-cache.svg)](https://www.npmjs.com/package/@aws-sdk/e


Version published
Weekly downloads
2M
increased by8.84%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/endpoint-cache?

@aws-sdk/endpoint-cache is a package that provides a caching mechanism for AWS SDK endpoints. It helps in reducing the number of endpoint resolution requests by caching the resolved endpoints, thus improving the performance of AWS SDK operations.

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

Creating an Endpoint Cache

This feature allows you to create an instance of the EndpointCache, which can be used to store and retrieve cached endpoints.

const { EndpointCache } = require('@aws-sdk/endpoint-cache');
const cache = new EndpointCache();

Adding an Endpoint to the Cache

This feature allows you to add an endpoint to the cache with a specified key and expiration time.

const endpoint = { address: 'https://example.com', expiration: Date.now() + 60000 };
cache.set('exampleKey', endpoint);

Retrieving an Endpoint from the Cache

This feature allows you to retrieve an endpoint from the cache using a specified key. If the endpoint is found and has not expired, it will be returned.

const cachedEndpoint = cache.get('exampleKey');
if (cachedEndpoint) {
  console.log('Cached endpoint:', cachedEndpoint.address);
} else {
  console.log('Endpoint not found in cache');
}

Deleting an Endpoint from the Cache

This feature allows you to delete an endpoint from the cache using a specified key.

cache.delete('exampleKey');

Other packages similar to @aws-sdk/endpoint-cache

FAQs

Package last updated on 02 May 2024

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