Last active
June 1, 2021 01:19
-
-
Save MauricioRobayo/64b347465c2d541cf94460faeb3df5c5 to your computer and use it in GitHub Desktop.
nodejs write to a file #gogofast
This file contains hidden or 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; | |
| fs.writeFile('helloworld.txt', 'Hello World!', 'utf8') | |
| .then(() => console.log('Hello World > helloworld.txt')) | |
| .catch((err) => console.log(err)); |
This file contains hidden or 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'); | |
| fs.writeFile('helloworld.txt', 'Hello World!', function (err) { | |
| if (err) return console.log(err); | |
| console.log('Hello World > helloworld.txt'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment