Skip to content

Instantly share code, notes, and snippets.

@zolotyh
Created February 3, 2020 07:08
Show Gist options
  • Save zolotyh/a1cd60d8e1a17f34dbd23c63d92a85d6 to your computer and use it in GitHub Desktop.
Save zolotyh/a1cd60d8e1a17f34dbd23c63d92a85d6 to your computer and use it in GitHub Desktop.
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();
@zolotyh
Copy link
Author

zolotyh commented Feb 3, 2020

Что делает этот код? Есть ли что-то, что можно улучшить?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment