Skip to content

Instantly share code, notes, and snippets.

@andymagill
Created August 27, 2024 01:37
Show Gist options
  • Save andymagill/edff540f179cc02cd55bf6ae7ab3e659 to your computer and use it in GitHub Desktop.
Save andymagill/edff540f179cc02cd55bf6ae7ab3e659 to your computer and use it in GitHub Desktop.
Create Project Skeleton in NODE.js
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!');
@andymagill
Copy link
Author

Can you guess what I'm building?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment