OSD600- Lab 10

 This is it... the final lab of OSD600! The semester is almost over, and although I have really enjoyed this course and learned so much, I can't wait for the semester to end! Mainly because this is my last one then I graduate 🎓! This lab helps tie everything we did this semester by asking us to publish our link checker programs! since I wrote mine in Node I started looking into how to publish it to npm. I must admit, publishing to npm was not as hard as I thought it would be. This YouTube video really helped guide me. I also read the docs. However, there was one problem with all these resources. They did not show how to publish a command-line tool to npm. I understand I could have modified some of my code so the user can require() it, but it didn't make sense to me. I felt the user experience would be more enjoyable if they can install and use it as a command-line tool! I asked David about this and he told me about npx! npx allows you to run modules from the terminal! This was perfect for having people run my tool from the command line. The process for creating my release was pretty simple. First, create an npm account, then from the terminal log in with the command npm log in. To upload the package, first give it a version number: npm version 1.0, and run npm publish. I did have to modify some of the files in my code since users will have to run it via npx. My professor sent me this package.json to study the contents and repository it's in since it is also part of npm and can be run via command line with npx. After studying this code, I realized the changes I had to make. First off, I needed to make a /bin folder and in there create a file which I  called BrokenLink.js this basically helps make the program an executable. Then I had to add some configuration in package.json. The only part I got stuck with was learning about npx. Before I started this lab I decided to do some research on npx and write some test code myself. What confused me was everyone online was saying npx should download the node module you want to test, it wasn't doing that in my case because I had space in my user name on windows, because of that you must first install the module you wish to test with npx, and install the npx node module. That was a good experience as it gave me the chance to learn more about npx. Another thing I want to mention is while trying to upload my package to npm I learned package names cant have upper cases (I never noticed that before). User testing went well, at first they were having a hard time running the program because they did not install npx with npm. This made me notice I forgot to say in my readMe you must npm install npx. Another interesting thing they found was the v and version arguments did not work! I looked at my code and noticed the conditions I put for that were gone! I have no idea how this happened but after looking at my git history I noticed around the end of October I deleted it by accident. We communicated via WhatsApp. In order to install my project run npm install jassal-link-checker. From there you can run it from the command line using npx!

Examples: 

npx  jassal-link-checker test.txt




npx  jassal-link-checker test.txt --good



npx  jassal-link-checker test.txt --bad



npx  jassal-link-checker v

View it on npm: https://www.npmjs.com/package/jassal-link-checker

Overall this lab went really well, it feels good looking at what I have accomplished from the beginning of the semester until now! I am really grateful I got to take to course and have David Humphrey as my professor. I learned a lot and believe it will make me ready to enter the industry!






Comments

Popular posts from this blog

OSD600 Release 0.4 Part 3

OSD600 Lab 5

Release 0.3 PR2