An open API service indexing awesome lists of open source software.

https://github.com/mnicole/s3-hosted-string-replace

Set of Node CLI scripts for downloading s3 files, doing string replaces, and re-uploading
https://github.com/mnicole/s3-hosted-string-replace

aws aws-cli cli javascript nodejs s3 s3-bucket

Last synced: 2 months ago
JSON representation

Set of Node CLI scripts for downloading s3 files, doing string replaces, and re-uploading

Awesome Lists containing this project

README

          

# S3 Hosted String Replace

### Description
Set of Node CLI scripts for downloading s3 files, doing string replaces, and reuploading them. Uses the aws-sdk package.

### Prerequisites
You must have your AWS keys stored locally to use this. See [aws config files](https://docs.aws.amazon.com/cli/latest/userguide/cli-config-files.html) for more information.

You must have node and npm.

Run `yarn install` or `npm install` to install the dependency (aws-sdk)

### Scripts
#### getFiles.js
Run: `node getFiles.js path/to/file/with/filenames path/to/folder/to/upload/them/to bucketName`

Example: `node getFiles.js files.txt ./files/ my-bucket-name`

The upload folders must already exist. Your files.txt should list each file name you want to download separated by a new line.

#### replaceStrings.js:
Run: `node replaceStrings.js path/to/folder/where/files/exist`

Example: `node replaceStrings.js /Users/you/stuff`

The folder must already exist. You should edit the replaceStrings.js file with the regex of what you want to replace.

#### uploadFiles.js
Run: `node uploadFiles.js path/to/folder/where/files/exist bucketName`

Example: `node uploadFiles.js /Users/you/stuff my-bucket-name`

The folder must already exist. This example uses Content-Type: text/html. You can change this in uploadFiles.js.