The aim of this project was to build a command-line application that dynamically generates a professional README.md file, based upon a user’s input.
The generated README should include the title of the project and (at least) the following sections:
- Description
- Contents
- Installation
- Usage
- License
- Contributions
- Testing
- Contacts
The License section should include a badge for the user’s selected license, and the Contacts section should include a link to the user’s GitHub profile and their email address.
The project specified that the application should be invoked by using the following command: node index.js
and should make use of the Inquirer package.
In addition to the above, and as per the project criteria, the application makes use of the Inquirer package. It also makes use of node.js
’s file system
module, path
module and util
module.
The javascript
files have been commented throughout with pseudocode (breaking the project into tasks) and comments have also been added to explain the functionality of the code.
If you haven’t already, please download node.js
to your machine before proceeding with the installation instructions.
- Clone this repository to your machine
- Open your terminal
- Navigate to the root of the newly cloned directory
- In the terminal, run
npm install
- The application is now ready to be used and is invoked using the command
node index.js
The user installs and invokes the application as above. Once invoked, the application asks the user a series of prompts. Validation is included on each prompt to ensure the user’s answers are satisfactory (e.g. not left blank).
The user’s answers to these prompts become the content of the generated README.
Upon answering all of the prompts, a confirmation message is displayed in the terminal and the user is instructed to check the output directory. Here they will find a README.md file, the contents of which includes the following:
- Title
- Contents
- Description
- Build
- Installation
- Usage
- Credits
- License
- Contributions
- Testing
- Contacts
The Contents table in the generated README is fully functional, the Build section includes badges of the user’s selected languages/technologies, and the License section includes a badge for the user’s selected license which links to the respective webpage. The Contacts section also includes links to the user’s GitHub profile and email address.
An example README generated by the application is included in this repository.
A walkthrough video, demonstrating the invoking of the application, the answering of the user prompts and a generated README is accessible via the link.
Credit given to edX (2023) for providing the application’s starter code. Credit also to Shields.io (no date) for the badges used in this README and the application itself.
All other credits are cited in the code comments and referenced below.
Select the badge or visit the LICENSE.txt
(above) for more information.
Code written by Code0Em (email/ GitHub).
edX (2023) Build new skills. Advance your career.
Geshan Manandhar (2023) A step-by-step guide to using Inquirer.js.
Ileriayo (2023) Badges for your personal developer branding, profile, and projects · GitHub.
lukas-h (2022) Markdown License Badges for your Project · GitHub.
Mastering JS (2020) The util.promisify() Function in Node.js.
Node.js (no date) Working with folders in Node.js.
SheCodes (no date) Form Validation for Emails using Regex and JavaScript.
Shields.io (no date) Static Badge.
Xpert Learning Assistant (2024) (accessed via Virtual Learning Environment).