Socket
Socket
Sign inDemoInstall

@aws-sdk/middleware-flexible-checksums

Package Overview
Dependencies
Maintainers
5
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/middleware-flexible-checksums

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


Version published
Weekly downloads
6.2M
increased by5.13%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/middleware-flexible-checksums?

@aws-sdk/middleware-flexible-checksums is a middleware package for the AWS SDK for JavaScript. It provides functionality to handle flexible checksums for AWS services, ensuring data integrity during transmission.

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

Adding Checksum to Requests

This feature allows you to add a checksum to your S3 PutObject requests to ensure data integrity during transmission.

const { S3Client, PutObjectCommand } = require('@aws-sdk/client-s3');
const { flexibleChecksumsMiddleware } = require('@aws-sdk/middleware-flexible-checksums');

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

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

const command = new PutObjectCommand({
  Bucket: 'example-bucket',
  Key: 'example-key',
  Body: 'Hello, world!',
});

client.send(command).then((response) => {
  console.log('Success', response);
}).catch((error) => {
  console.error('Error', error);
});

Validating Checksum in Responses

This feature allows you to validate the checksum in the response from an S3 GetObject request to ensure data integrity.

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

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

client.middlewareStack.add(flexibleChecksumsMiddleware(), {
  step: 'deserialize',
  priority: 'high',
});

const command = new GetObjectCommand({
  Bucket: 'example-bucket',
  Key: 'example-key',
});

client.send(command).then((response) => {
  console.log('Success', response);
}).catch((error) => {
  console.error('Error', error);
});

Other packages similar to @aws-sdk/middleware-flexible-checksums

FAQs

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