2023-03-10 homework.
Node, npm learning second homework
Writing and reading data to files, readline , imports, exports, npm packages install, validation, terminal application.
🎯 Goals:
-
-
Use faker npm package and Generate string made of: name, surname, password, email address and birthday.
-
Write a program to generate people.txt file filled with random person's data.
-
Every line should end with "\n" new line character.
-
-
-
Extend current program to only allow use program for user with login details:
-
login: admin
-
password:1234
-
-
If login details do not match, show red message in a terminal: "Wrong login details";
-
If new data was successfully saved show message : "Data was successfully saved";
-
-
- Extend program to allow logged in user to save more data to file OR check (read) file;
-
Bonus
-
Write NodeJs program, using readline module to allow user enter these values:
- Name
- Surname
- Password
- Email address
- Birthday
using terminal.
-
Check if values are not empty and email address is in valid format.
-
Write a program to save provided data to json file named "registration.json".
-
Show red messages on error;
-
If registration successful show green message "Registration successful";
-
Task For myself: to practice more few extra validations (valid date, length)
-
Must have Node.js installed
-
Clone the repo
-
Go into project directory and Install NPM packages
npm install
-
run index.js for help
node .
or
npm start
-
use application:
npm run task1
npm run task2
npm run task3
npm run bonus