Skip to content

Commit

Permalink
nodejs init
Browse files Browse the repository at this point in the history
  • Loading branch information
csxiaoyaojianxian committed Jun 20, 2017
1 parent 83f4931 commit beb7c6e
Show file tree
Hide file tree
Showing 277 changed files with 40,882 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 8 node/.idea/8 node.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions 8 node/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions 8 node/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

272 changes: 272 additions & 0 deletions 8 node/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions 8 node/01-回调函数.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* @Author csxiaoyao
* @DateTime 2017-06-20
* @copyright [copyright]
* @license [license]
* @version [version]
*/

// 【普通阻塞方式】
// sunshine studio
// 程序执行结束!
var fs = require("fs");
var data = fs.readFileSync('input.txt');
console.log(data.toString());
console.log("程序执行结束!");

// 【回调函数方式】
// 程序执行结束!
// sunshine studio
var fs = require("fs");
fs.readFile('input.txt', function (err, data) {
if (err) {
console.log(err.stack);
return;
}
console.log(data.toString());
});
console.log("程序执行结束!");

0 comments on commit beb7c6e

Please sign in to comment.