Question: In this assignment, you will be creating a simple recipe application using the Node.js CommonJS module system. You will need to implement the following tasks:
In this assignment, you will be creating a simple recipe application using the Node.js CommonJS module system. You will need to implement the following tasks:
Create a createRecipe function points: This function should take an array of ingredients and return a string in the format Recipe created with ingredients: ingredient ingredient
Create a setTimer function points: This function should take a number of minutes and return a string in the format: Timer set for X minutes.
Create a quit function points: This function should return the string Program exited
Use the index.js file to demonstrate the functionality of your modules points
Create a package.json file points: This file should include a start script and a test script. The start script should execute the index.js file see step and the test script should execute the tester.js file. If you need help setting these up refer to your reading materials.
Set up the start and test scripts correctly points: The start script should run your index.js file, and the test script should run the tester.js script.
Note: Each of these functions should be placed in the recipes.js file and exported using Node.jss CommonJS module system. Once you have completed your assignment, you can test your code by running the tester.js script. You can do this by using one of the following methods:
Run node testers.js in the terminal. This will run the script directly.
Run npm test in the terminal. This will run the test script from the package.json file, which should execute the tester.js script. If all tests pass, you will see the message All tests passed! If any of the tests fail, you will see an error message with an explanation of why the test failed.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
