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

@aws-sdk/middleware-endpoint

Package Overview
Dependencies
Maintainers
5
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/middleware-endpoint

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

  • 3.224.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-6.12%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/middleware-endpoint?

The @aws-sdk/middleware-endpoint package is part of the AWS SDK for JavaScript v3. It is used to manage and resolve endpoints in AWS service calls. This middleware allows developers to customize endpoint resolution logic, which can be useful for directing requests to specific regions, using custom domain names, or working with mock endpoints for testing purposes.

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

Custom Endpoint Resolution

This code demonstrates how to use the @aws-sdk/middleware-endpoint package to customize the endpoint for an S3 client. It adds a middleware that resolves to a custom endpoint, which is useful for directing requests to a specific server or for testing with mock endpoints.

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

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

client.middlewareStack.add(endpointMiddleware({
  endpoint: () => ({
    protocol: 'https:',
    hostname: 'my-custom-s3-endpoint.com',
    path: '/',
    query: {}
  })
}), {
  step: 'build'
});

const command = new GetObjectCommand({ Bucket: 'example-bucket', Key: 'example-object' });
client.send(command);

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

FAQs

Package last updated on 05 Dec 2022

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