SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const fs = require('fs');
  2. fs.writeFile("test.txt", "Hey there!", function(err) {
  3.     if(err) {
  4.         return console.log(err);
  5.     }
  6.  
  7.     console.log("The file was saved!");
  8. });
  9.  
  10. fs.readFile('test.txt', 'utf8', function(err, contents) {
  11.     console.log(contents);
  12. });
  13.  
  14. console.log('after calling readFile');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top