Created
August 27, 2024 01:37
-
-
Save andymagill/edff540f179cc02cd55bf6ae7ab3e659 to your computer and use it in GitHub Desktop.
Create Project Skeleton in NODE.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
const directories = [ | |
'src/lib/components', | |
'src/lib/stores', | |
'src/lib/utils', | |
'src/routes/history', | |
'src/routes/reports', | |
'static' | |
]; | |
const files = [ | |
'src/lib/components/Timer.svelte', | |
'src/lib/components/TaskInput.svelte', | |
'src/lib/components/TagSelector.svelte', | |
'src/lib/components/TaskList.svelte', | |
'src/lib/components/ReportChart.svelte', | |
'src/lib/components/Navigation.svelte', | |
'src/lib/stores/timerStore.js', | |
'src/lib/stores/taskStore.js', | |
'src/lib/utils/timeUtils.js', | |
'src/routes/history/+page.svelte', | |
'src/routes/reports/+page.svelte', | |
'static/manifest.json' | |
]; | |
directories.forEach(dir => { | |
fs.mkdirSync(path.join(__dirname, dir), { recursive: true }); | |
console.log(`Created directory: ${dir}`); | |
}); | |
files.forEach(file => { | |
fs.writeFileSync(path.join(__dirname, file), ''); | |
console.log(`Created file: ${file}`); | |
}); | |
console.log('Project structure setup complete!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you guess what I'm building?