Skip to content

codevivi/saving-data-to-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🪧Saving data to file

📋 About

2023-03-10 homework.

Node, npm learning second homework

Writing and reading data to files, readline , imports, exports, npm packages install, validation, terminal application.

alt app screenshot

🎯 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;
  1. 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)

🏁 Getting started

Must have Node.js installed

  1. Clone the repo

  2. Go into project directory and Install NPM packages

    npm install
  3. run index.js for help

     node .

    or

     npm start
  4. use application:

    npm run task1
    npm run task2
    npm run task3
    npm run bonus

About

terminal application to save random user data to file or save registration details to json file

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published