diff --git a/lesson3/challenges/copyFile.js b/lesson3/challenges/copyFile.js index c111689..d7268bd 100644 --- a/lesson3/challenges/copyFile.js +++ b/lesson3/challenges/copyFile.js @@ -2,5 +2,10 @@ var fs = require('fs'); // 1. Do this synchronously first +const contents = fs.readFileSync('hello.html'); +fs.writeFileSync('hello-copy.html', contents); // 2. Do the same thing asynchronously +fs.readFile('hello.html', (contents) => { + fs.writeFile('hello-copy.html', contents); +});