PROG3017 FullStack Lab2b
PROG3017 FullStack Lab2b
Prerequisites
Make sure that your Node.js development environment is set up as per the instructions in
class and that Node and npm are both available.
Using the link on Brightspace, make sure you clone down the Lab2b Github Classroom
repository. You will do all of your work in the repository.
Instructions
Step 1- Custom Modules
Create all required files for this section in a folder that you create called Step1.
Watch the introductory video entitled Node.js Tutorial for Beginners: Learn Node in 1 Hour |
Mosh (https://youtu.be/TlB_eWDSMt4 ). Pay particular attention to the section where you will
create your own custom module. (Starting at 22:53 - https://youtu.be/TlB_eWDSMt4?t=1373 )
1. Using the example that is created in the video for creating your own module, create a
module called primeNumberChecker that does the following.
a. Exports a function called isPrime which takes in a number as an argument and
returns true or false depending on whether it is a prime number or not. You can
search online for an example of prime number checking that you can use in the
module.
2. In a file called app.js, import the primeNumberChecker module and demonstrate usage of
it within the application.
W3Schools - https://www.w3schools.com/nodejs/nodejs_filesystem.asp