You must hand in by using git
bitbucket.org,
gitlab.com, or
github.com,
git push your local repo to the above remote repo.
node_modules/
.gitignore file.
Send a mail to <nmla@iba.dk> with:
handin <subjectname>'
in the subject line of your mail
This assignment is to follow in the steps of your textbook,
[Wex19] section 3.2.
Please notice the procedural remark about
.gitignore.
Write a module containing af function that returns true if all provided parameters have values, and false otherwise.
In the browser, the window object has a prompt
method. We don't have the window.
Here is a code snippet as a helper:
// on console: npm i readline-sync
const readline = require('readline-sync');
let name = readline.question("Enter name: ");
console.log(`Hi ${name}`);
Now write a JavaScript/node program requesting the user to enter
a userid on the console. Then ask her to enter
an email address on the console.
When both have been accomplished, write the two pieces of
information into a text file on your computer.
You might consider using the module from the previous assignment to check for values in the user entered data.
Think about the format for storing the information in the file. Make a comment in the program that reflects your choice and why.
Write a JavaScript/node program that reads user/email values from the file from the section called “Assignment Node I.1” and prints them on the console.
Write a JavaScript/node program that prompts the user for a userid, then searches for that particular userid in the file from the section called “Assignment Node I.1” and returns the corresponding email address on the console.
Write a new version of the program from the section called “Assignment Node I.1” so that it allows only one entry for each userid. This means that if the userid already exists, the entry should be rejected.
Write yet another version of the program from the section called “Assignment Node I.1” so that it allows only one entry for each userid. In this case if the userid already exists, the entry should be changed to the new email address.