A script to generate a directory with custom name and three files 'index.html', 'app.js', and 'styles.css'. There is a default template at index.html as well.
- Ensure you have Node.js installed on your system.
- If not yet, Link to Download Node JS
-
Open Terminal:
- Navigate to the directory where your script is located.
-
Run the Script:
- Use the following command to run the script:
node yourScriptName.js [folderName]
- Replace
yourScriptName.jswith the actual name of your script file. [folderName]is optional. If not provided, the default nameProjectwill be used.
-
Directory Handling:
- If a directory with the specified name already exists, the script will prompt:
Directory [folderName] already exists. Type YES to replace it, Type NO to terminate:- Type
YESto delete the existing directory and create a new one. - Type
NOto terminate the operation without making any changes.
-
Files Created:
index.html: Contains default HTML content.app.js: An empty JavaScript file.styles.css: An empty CSS file.