Created
January 10, 2014 03:00
-
-
Save KJlmfe/8346301 to your computer and use it in GitHub Desktop.
Node同步执行
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
var fs = require('fs'); | |
//同步读取文件内容 | |
var data = fs.readFileSync('Hello.txt','utf-8'); | |
console.log(data); | |
console.log('End'); | |
/* | |
运行结果: | |
Hello World | |
End | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment