Created
December 16, 2021 10:47
-
-
Save zolotyh/1aa68d7fdd629cd91e8cefe3ef7b41d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'fs/promises' | |
function write(){ | |
return fs.mkdir('./tmp').then(function(){ | |
fs.writeFile('./tmp/foo.txt', 'Hello World'); | |
}).catch((err) => { | |
/// handle error | |
console.log(err); | |
}); | |
} | |
write(); | |
// What does this code do? Is there anything that could be improved? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment