Socket that makes a TCP connection with server.js
on port 3001.
Calls a series of functions to read a file, convert the content to all uppercase characters, and re-write the file with the new content. Emits an event upon completing the process or a different event if an error occurs.
Calls the promisify-ed fs.readFile
function. Takes a filepath to read as a parameter, ultimately returns a buffer of the data in that file.
Takes buffer data as a parameter, returns a buffer of the same content in uppercase characters.
Calls the promisify-ed fs.writeFile
function. Takes a filepath and buffer data as parameters, ultimately writes new file with the filepath of file
with the contents
.
The TCP server. Accepts connections from sockets on port 3001.
npm i
- install dependencies
npm node app.js dummy.txt
- To run tests, enter the following in the CLI:
npm run test
npm run lint