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 1.0.0 to 2.0.0

8

bin/s3-sync.js

@@ -48,2 +48,8 @@ #!/usr/bin/env node

},
mutableHtml: {
description:
'(Optional) Treat all HTML files as mutable, even if not specified by --mutableFilenames',
type: 'boolean',
default: true,
},
compressExtensions: {

@@ -183,2 +189,3 @@ alias: 'compress',

aliasPages,
mutableHtml,
_,

@@ -197,2 +204,3 @@ } = program.argv;

cloudFront: distributionId && createCloudFront(distributionId),
mutableHtml,
})

@@ -199,0 +207,0 @@ .then(() => {

29

lib/push/push.js

@@ -16,2 +16,3 @@ 'use strict';

aliasHtmlPages = true,
mutableHtml = true,
} = {}) =>

@@ -21,13 +22,15 @@ getFilenames({ s3, distDir }).then(({ localFilenames, remoteFilenames }) => {

const remoteFilenameSet = new Set(remoteFilenames);
const htmlAliases = aliasHtmlPages
? localFilenames
.filter(
(localFilename) =>
localFilename.endsWith('.html') &&
!localFilename.endsWith('index.html')
)
.map((localFilename) => localFilename.replace('.html', ''))
: [];
const htmlAliasSet = new Set(
aliasHtmlPages
? localFilenames
.filter(
(localFilename) =>
localFilename.endsWith('.html') &&
!localFilename.endsWith('index.html')
)
.map((localFilename) => localFilename.replace('.html', ''))
: []
);
const uploadFilenames = localFilenames
.concat(htmlAliases)
.concat(Array.from(htmlAliasSet))
.filter((localFilename) => {

@@ -40,3 +43,5 @@ const destinationFilename = getRemoteDestinationFilename(

mutableFilenameSet.has(destinationFilename) ||
!remoteFilenameSet.has(destinationFilename)
!remoteFilenameSet.has(destinationFilename) ||
(mutableHtml && destinationFilename.endsWith('.html')) ||
(mutableHtml && htmlAliasSet.has(localFilename))
);

@@ -64,4 +69,2 @@ });

const htmlAliasSet = new Set(htmlAliases);
return Promise.all(

@@ -68,0 +71,0 @@ uploadFilenames.map((localPath) => {

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

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

@@ -56,2 +56,9 @@ # @alexbainter/s3-sync

##### Mutable HTML (optional)
If enabled, treats all HTML files (and aliases, if applicable) as mutable. Defaults to `true`.
- CLI: `--mutableHtml`,
- Environment variable: `S3_SYNC_MUTABLE_HTML=<true/false>`
##### Dry Run (optional)

@@ -58,0 +65,0 @@

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