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

@aws-sdk/middleware-endpoint-discovery

Package Overview
Dependencies
Maintainers
5
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/middleware-endpoint-discovery

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

  • 3.709.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.5M
increased by12.11%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/middleware-endpoint-discovery?

@aws-sdk/middleware-endpoint-discovery is a middleware package for the AWS SDK for JavaScript. It provides functionality to automatically discover and cache endpoints for AWS services that support endpoint discovery. This can help improve performance and reliability by reducing the need to repeatedly look up endpoints.

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

Automatic Endpoint Discovery

This feature enables automatic endpoint discovery for AWS services. In this example, the S3Client is configured to enable endpoint discovery. When the ListBucketsCommand is sent, the middleware will automatically discover and cache the appropriate endpoint.

const { EndpointDiscoveryMiddleware } = require('@aws-sdk/middleware-endpoint-discovery');
const { S3Client, ListBucketsCommand } = require('@aws-sdk/client-s3');

const client = new S3Client({
  region: 'us-west-2',
  endpointDiscoveryEnabled: true
});

const command = new ListBucketsCommand({});

client.send(command).then((data) => {
  console.log(data);
}).catch((error) => {
  console.error(error);
});

Manual Endpoint Discovery

This feature allows for manual configuration of endpoint discovery. In this example, the EndpointDiscoveryMiddleware is manually added to the middleware stack of the S3Client. The middleware is configured to require a discovered endpoint.

const { EndpointDiscoveryMiddleware } = require('@aws-sdk/middleware-endpoint-discovery');
const { S3Client, ListBucketsCommand } = require('@aws-sdk/client-s3');

const client = new S3Client({
  region: 'us-west-2'
});

const command = new ListBucketsCommand({});

client.middlewareStack.add(EndpointDiscoveryMiddleware({
  isDiscoveredEndpointRequired: true
}), {
  step: 'build',
  priority: 'high'
});

client.send(command).then((data) => {
  console.log(data);
}).catch((error) => {
  console.error(error);
});

Other packages similar to @aws-sdk/middleware-endpoint-discovery

FAQs

Package last updated on 10 Dec 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