node read file fs

var fs = require("fs")
fs.readFile("file.txt","UTF-8",function(err,data){
    if(err){
        console.log("err")
    }else{
        console.log(data)
    }
})
console.log("end");

 

posted @ 2016-07-26 15:49  sunbey80  阅读(169)  评论(0编辑  收藏  举报