Created
July 11, 2016 20:52
-
-
Save mariyadiminsky/597d52a7f082fbc352d068a82e12f120 to your computer and use it in GitHub Desktop.
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
// blocking / sync code: | |
// you have to require the file system(fs), Node.js's core module for it to work: | |
var fs = require('fs'); | |
// First read the file 'wishlist.html' synchronously using the readFileSync method: | |
// We have to use the toString because it returns as a buffer. | |
// You can learn about buffers in the resources I provide at the end of this article. | |
var wishlist = fs.readFileSync('wishlist.html').toString(); | |
//print the file | |
console.log(wishlist); | |
// Do another thing: | |
console.log('ALERT: Pounce owner!!!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment