CLI tool synchronizing local directories with AWS S3 using streaming multipart uploads.
Tick off requirements as you build to track real-time completion.
Follow this chronological guide to build the project from scratch.
Recursively scan local directory and calculate MD5 checksums for diff comparison.
import fs from 'fs';
import path from 'path';
import crypto from 'crypto';
export interface FileMeta {
relativePath: string;
absolutePath: string;
hash: string;
}
export function scanDirectory(dirPath: string, baseDir = dirPath): FileMeta[] {
let results: FileMeta[] = [];
const list = fs.readdirSync(dirPath);
list.forEach((file) => {
const fullPath = path.join(dirPath, file);
const stat = fs.statSync(fullPath);
if (stat && stat.isDirectory()) {
results = results.concat(scanDirectory(fullPath, baseDir));
} else {
const buffer = fs.readFileSync(fullPath);
const hash = crypto.createHash('md5').update(buffer).digest('hex');
results.push({ relativePath: path.relative(baseDir, fullPath), absolutePath: fullPath, hash });
}
});
return results;
}Real issues students hit during development and how to troubleshoot them fast.
Continue building your skills with similar projects.
Sleek weather dashboard using OpenWeather API with geolocation, 5-day forecast, and dynamic weather themes.
Personal budget tracker with transaction log, category breakdown, and Chart.js pie charts.
Movie discovery app with TMDB API, trending lists, search, and detail modals.