Gathering detailed insights and metrics for @jeffbski-rga/aws-s3-multipart-copy
Gathering detailed insights and metrics for @jeffbski-rga/aws-s3-multipart-copy
Gathering detailed insights and metrics for @jeffbski-rga/aws-s3-multipart-copy
Gathering detailed insights and metrics for @jeffbski-rga/aws-s3-multipart-copy
A wrapper for npm aws-sdk that manages multipart copy process
npm install @jeffbski-rga/aws-s3-multipart-copy
Typescript
Module System
Node Version
NPM Version
64.7
Supply Chain
99.4
Quality
75.2
Maintenance
100
Vulnerability
100
License
JavaScript (65.74%)
TypeScript (34.26%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
113 Commits
2 Watchers
11 Branches
1 Contributors
Updated on Mar 12, 2024
Latest Version
4.0.0
Package Id
@jeffbski-rga/aws-s3-multipart-copy@4.0.0
Unpacked Size
67.79 kB
Size
15.99 kB
File Count
6
NPM Version
10.2.4
Node Version
20.11.1
Published on
Apr 01, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
Fork of aws-s3-multipart-copy to fix issues with broken dependencies from snyk
Also includes code from https://github.com/spencer-jacobs/aws-s3-multipart-copy which switched to using AWS SDK V3.
Wraps aws-sdk with a multipart-copy manager, in order to provide an easy way to copy large objects from one bucket to another in aws-s3. The module manages the copy parts order and bytes range according to the size of the object and the desired copy part size. It speeds up the multipart copying process by sending multiple copy-part requests simultaneously.
This fork allows you to provide the exact AWS SDK V3 version that you want to use in the createDeps function rather than requiring this library to continuously be updated. The output deps awsClientDeps
are then provided to the CopyMultipart constructor. This structure also makes it easy to mock out awsClientDeps for testing.
** The package supports aws-sdk version '2006-03-01' and above.
** The package supports node 8 version and above.
npm install @jeffbski-rga/aws-s3-multipart-copy
See the docs below for full details and parameter options. This is a quick overview of how to use the library.
1const { 2 S3Client, 3 CreateMultipartUploadCommand, 4 AbortMultipartUploadCommand, 5 CompleteMultipartUploadCommand, 6 UploadPartCopyCommand, 7 ListPartsCommand 8} = require("@aws-sdk/client-s3"), 9 10const awsClientS3Commands = { 11 CreateMultipartUploadCommand, 12 AbortMultipartUploadCommand, 13 CompleteMultipartUploadCommand, 14 UploadPartCopyCommand, 15 ListPartsCommand 16}; 17const awsClientDeps = createDeps(awsClientS3Commands); 18 19const s3Client = new S3Client({ region: 'us-east-1' }); 20const params = { /* copyObjectMultipartParams here */ }; 21const copyMultipart = new CopyMultipart({ s3Client, awsClientDeps, params }); 22copyMultipart.done() 23 .then((result) => { 24 console.log(result); 25 }) 26 .catch((err) => { 27 // handle error 28 });
1import { 2 S3Client, 3 CreateMultipartUploadCommand, 4 AbortMultipartUploadCommand, 5 CompleteMultipartUploadCommand, 6 UploadPartCopyCommand, 7 ListPartsCommand 8} from "@aws-sdk/client-s3"; 9 10const awsClientS3Commands = { 11 CreateMultipartUploadCommand, 12 AbortMultipartUploadCommand, 13 CompleteMultipartUploadCommand, 14 UploadPartCopyCommand, 15 ListPartsCommand 16}; 17const awsClientDeps = createDeps(awsClientS3Commands); 18 19const s3Client = new S3Client({ region: 'us-east-1' }); 20const params = { /* copyObjectMultipartParams here */ }; 21const copyMultipart = new CopyMultipart({ s3Client, awsClientDeps, params }); 22await copyMultipart.done();
aws-s3-multipart-copy is based on the aws-sdk, so createDeps creates a flattened dependency object with async fns that perform s3 commands.
If resilience is desired then these s3 functions can be wrapped to retry on certain types of errors.
1const { 2 S3Client, 3 CreateMultipartUploadCommand, 4 AbortMultipartUploadCommand, 5 CompleteMultipartUploadCommand, 6 UploadPartCopyCommand, 7 ListPartsCommand 8} = require("@aws-sdk/client-s3"), 9 10const awsClientS3Commands = { 11 CreateMultipartUploadCommand, 12 AbortMultipartUploadCommand, 13 CompleteMultipartUploadCommand, 14 UploadPartCopyCommand, 15 ListPartsCommand 16}; 17 18const awsClientDeps = createDeps(awsClientS3Commands); 19/* 20{ 21 s3CreateMultipartUpload: (s: s3Client, p: CreateMultipartUploadCommandInput, h: HttpHandlerOptions) => Promise<CreateMultipartUploadCommandOutput>; 22 s3UploadPartCopy: (s: s3Client, p: UploadPartCopyCommandInput, h: HttpHandlerOptions) => Promise<UploadPartCopyCommandOutput>; 23 s3AbortMultipartUpload: (s: s3Client, p: AbortMultipartUploadCommandInput, h: HttpHandlerOptions) => Promise<AbortMultipartUploadCommandOutput>; 24 s3ListParts: (s: s3Client, p: ListPartsCommandInput) => Promise<ListPartsCommandOutput>; 25 s3CompleteMultipartUpload: (s: s3Client, p: CompleteMultipartUploadCommandInput, h: HttpHandlerOptions) => Promise<CompleteMultipartUploadCommandOutput>; 26}
1const {createDeps, CopyMultipart } = require('@jeffbski-rga/aws-s3-multipart-copy'); 2 3const { 4 S3Client, 5 CreateMultipartUploadCommand, 6 AbortMultipartUploadCommand, 7 CompleteMultipartUploadCommand, 8 UploadPartCopyCommand, 9 ListPartsCommand, 10} = require("@aws-sdk/client-s3"); 11 12const awsClientS3Commands = { 13 CreateMultipartUploadCommand, 14 AbortMultipartUploadCommand, 15 CompleteMultipartUploadCommand, 16 UploadPartCopyCommand, 17 ListPartsCommand, 18}; 19const awsClientDeps = createDeps(awsClientS3Commands);
Create a new instance of CopyMultipart class to prepare for use.
** Objects size for multipart copy must be at least 5MB.
The method receives two parameters: options and request_context
A successful result might hold any of the following keys as specified in aws s3 completeMultipartUpload docs
In case multipart copy fails, three scenarios are possible:
Positive
1const bunyan = require('bunyan'); 2const { createDeps, CopyMultipart } = require("@jeffbski-rga/aws-s3-multipart-copy"); 3const { 4 S3Client, 5 CreateMultipartUploadCommand, 6 AbortMultipartUploadCommand, 7 CompleteMultipartUploadCommand, 8 UploadPartCopyCommand, 9 ListPartsCommand, 10} = require("@aws-sdk/client-s3"), 11 12const awsClientS3 = { 13 CreateMultipartUploadCommand, 14 AbortMultipartUploadCommand, 15 CompleteMultipartUploadCommand, 16 UploadPartCopyCommand, 17 ListPartsCommand, 18}; 19const s3ClientConfig = {}; 20const s3Client = new S3Client(s3ClientConfig); 21const awsClientDeps = createDeps(awsClientS3); 22 23const logger = bunyan.createLogger({ 24 name: 'copy-object-multipart', 25 level: 'info', 26 version: 1.0.0, 27 logType: 'copy-object-multipart-log', 28 serializers: { err: bunyan.stdSerializers.err } 29 }); 30 31const request_context = "request_context"; 32const params = { 33 source_bucket: "source_bucket", 34 object_key: "object_key", 35 destination_bucket: "destination_bucket", 36 copied_object_name: "someLogicFolder/copied_object_name", 37 object_size: 70000000, 38 copy_part_size_bytes: 50000000, 39 copied_object_permissions: "bucket-owner-full-control", 40 expiration_period: 100000, 41 storage_class: 'STANDARD' 42}; 43 44const copyMultipart = new CopyMultipart({ s3Client, awsClientDeps, params, logger, requestContext}); 45return copyMultipart.done() 46 .then((result) => { 47 console.log(result); 48 }) 49 .catch((err) => { 50 // handle error 51 }); 52 53/* Response: 54 result = { 55 Bucket: "acexamplebucket", 56 ETag: "\"4d9031c7644d8081c2829f4ea23c55f7-2\"", 57 Expiration: 100000, 58 Key: "bigobject", 59 Location: "https://examplebucket.s3.amazonaws.com/bigobject" 60 } 61 */
Negative 1 - abort action passed but copy parts were not removed
1/* 2 err = { 3 message: 'Abort procedure passed but copy parts were not removed' 4 details: { 5 Parts: ['part 1', 'part 2'] 6 } 7 } 8 */
Negative 2 - abort action succeded
1/* 2 err = { 3 message: 'multipart copy aborted', 4 details: { 5 Bucket: destination_bucket, 6 Key: copied_object_name, 7 UploadId: upload_id 8 } 9 } 10 */
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
9 existing vulnerabilities detected
Details
Reason
Found 0/19 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More