Skip to content

Instantly share code, notes, and snippets.

View kristianw's full-sized avatar

Kristian Walsh kristianw

  • Melbourne, Australia
View GitHub Profile
import { GetObjectCommand, S3Client } from '@aws-sdk/client-s3';
import { Readable } from 'stream';
import { logger } from 'logger';
export class S3Storage {
private readonly s3Client: S3Client;
constructor() {
this.s3Client = new S3Client({
region: process.env.REGION!,
async function uploadDirectoryFilesToS3(dir) {
try {
console.debug('Attempting to upload files to S3')
let downloadLinks = [];
const pathRegex = new RegExp('(.[/]tmp[/]|.[/])Properties[/](VIC|QLD|NSW|ACT|SA|NT|WA)[/](.*)/')
let folderNameResult = pathRegex.exec(dir)
let path = await fs.readdirSync(dir);
for (let filename of path) {
@kristianw
kristianw / launch.json
Created October 5, 2023 23:28
Default TS/TS VS Code Launch Configuration
{
"version": "0.2.0",
"configurations": [
{
"type": "node-terminal",
"name": "Debug Current JS File (node)",
"request": "launch",
"command": "node -- ${fileBasenameNoExtension}",
"cwd": "${fileDirname}"
},
@kristianw
kristianw / setup-volta-binaries-link.sh
Last active May 23, 2024 05:06
Linking Volta Managed binaries to /usr/local/bin