1 function that given a file path creates a file on the file system and logs out whether the file was created or not
1 function that given a file path reads a file on the file system and logs the contents out
1 function that given a file path deletes a file on the file system and logs out whether it successfully deleted that file or not
1 function that given a file path and a string updates the file at the file path with the given string and logs out whether it was successful
After the function definitions create a variable and assign it a string that is a file path using process.cwd and path.join. Call the functions in the below order passing it in as a parameter.
Call the create file function
Call the Update file function with a random string
Call the Read file function
Call the Delete file function
Notes
Recommend using fs/promises API as it's simpler than the callbacks API
src/index.js
have the following:process.cwd
andpath.join
. Call the functions in the below order passing it in as a parameter.Notes
fs/promises
API as it's simpler than the callbacks APIReferences
process.cwd
path.join