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

@alexbainter/s3-sync

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alexbainter/s3-sync - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

33

lib/prune/prune-remote.js

@@ -6,2 +6,4 @@ 'use strict';

const MAX_OBJECT_COUNT_PER_REQUEST = 1000;
const pruneRemote = ({

@@ -35,10 +37,27 @@ s3,

return (dryRun
? Promise.resolve()
: s3
.deleteObjects({
Delete: { Objects: deleteFilenames.map((key) => ({ Key: key })) },
const deleteGroups = deleteFilenames.reduce(
(groups, filename, i) => {
const groupIndex = Math.floor(i / MAX_OBJECT_COUNT_PER_REQUEST);
groups[groupIndex].push(filename);
return groups;
},
Array.from(
{
length: Math.ceil(
deleteFilenames.length / MAX_OBJECT_COUNT_PER_REQUEST
),
},
() => []
)
);
const deleteRequests = deleteGroups.map((filenames) =>
dryRun
? Promise.resolve()
: s3.deleteObjects({
Delete: { Objects: filenames.map((key) => ({ Key: key })) },
})
.promise()
).then(() => {
);
return Promise.all(deleteRequests).then(() => {
console.log(

@@ -45,0 +64,0 @@ `Removed ${deleteFilenames.length} files:\n${deleteFilenames.join(

{
"name": "@alexbainter/s3-sync",
"version": "0.2.1",
"version": "0.2.2",
"description": "Transfer files to and from S3",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

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