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
- Host: GitHub
- URL: https://github.com/mnicole/s3-hosted-string-replace
- Owner: mnicole
- Created: 2018-07-27T00:29:02.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-30T20:04:43.000Z (almost 8 years ago)
- Last Synced: 2025-06-03T06:09:28.594Z (about 1 year ago)
- Topics: aws, aws-cli, cli, javascript, nodejs, s3, s3-bucket
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.