Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. var fs = require('fs');
  2. var timestamp = new Date().toString();
  3. fs.writeFile('date.txt', timestamp, function (err) {
  4. if (err) throw err;
  5. fs.readFile('date.txt', function (err, contents) {
  6. if (err) throw err;
  7. console.log('Checking the contents'); // 2
  8. console.log(contents);
  9. console.assert(contents == timestamp); // 3
  10. });
  11. });
  12. console.log('I am the last line of the script'); // 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement