Lab 3 Blog

    This time for our Lab 3, we were assigned to add two features into the CLI tool project that we worked on from Release 0.1. We have to first send an issue to the repository, and then close the issue after merging the issued branch with the original one.

    The first feature that I decided to add to my program was to add '--good', '--bad', and '--all' arguments to the command-line tool, this feature will allow the user to filter out the resulting URLs according to the arguments that are present. I made sure that all the arguments can be applied at the same time. If the user wished to see both good and bad arguments, then all they had to do is include both arguments into the command. Additionally, the arguments can be put in any order of which it is entered. Meaning that it will read the file location correctly no matter which position of the arguments it is in.

    As the first feature went smoothly, the second feature wasn't completed as fast. The second feature I chose to implement was the '--json' argument, which will allow the output of the program to be displayed in JSON format, instead of the default strings. First, I had to resolve the object every time it loops to determine the URLs' status,  and then I had to use Promise.all() to ensure that everything had completed its promises before finally displaying the JSON format results. After that, I also made sure that the '--json' argument feature was compatible with the first feature. Which will allow the JSON output to be also filtered.


Comments

Popular posts from this blog

Lab 2 Blog

Lab 4 Blog

Release 0.4