Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 971 Bytes

File metadata and controls

39 lines (28 loc) · 971 Bytes

Practical 8

  • Create a file index.js
  • Perform the following operations using fs module of NodeJS

Note: Each operation should be perfomed synchronously as well as asynchronously

  1. Create a folder space_project

  1. Inside the folder, create a file log.txt and add the line "ISRO is planning Gaganyaan mission, ie an Indian crewed orbital spacecraft."

  1. Now, replace the line in the log.txt file with "ISRO has started working on Gaganyaan."

  1. Append another line to the log.txt file " The current Aditya-L1 team of scientists is mentoring new talent for working on the Gaganyaan mission."

  1. Rename the log.txt file to update.txt

  1. Read the update.txt file and display the data. Additionally print a line "We are excited" using console.log() after the read operation

  1. Delete the file update.txt

  1. Delete the folder space_project