This commit is contained in:
2025-09-05 14:38:22 -05:00
commit 4ffef1cc88
8 changed files with 272 additions and 0 deletions

30
index.js Normal file
View File

@@ -0,0 +1,30 @@
const { processAndOrganizeNotes } = require('./src/noteOrganizer');
const { writeOrganizedNotes } = require('./src/outputWriter');
async function main() {
try {
const args = process.argv.slice(2);
if (args.length < 1 || args.length > 2) {
console.log('Usage: node index.js <directory_path> [file_pattern]');
return;
}
const [dirPath, pattern] = args;
console.log(`Starting to process notes in: ${dirPath}`);
if (pattern) {
console.log(`Filtering by pattern: ${pattern}`);
}
const organizedNotes = await processAndOrganizeNotes(dirPath, pattern);
if (organizedNotes) {
writeOrganizedNotes(__dirname, organizedNotes);
}
} catch (error) {
console.error('An unexpected error occurred:', error);
}
}
main();