Created
February 3, 2020 07:08
-
-
Save zolotyh/a1cd60d8e1a17f34dbd23c63d92a85d6 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
const fs = require('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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Что делает этот код? Есть ли что-то, что можно улучшить?