Skip to content

Instantly share code, notes, and snippets.

@KJlmfe
Created January 10, 2014 03:00
Show Gist options
  • Select an option

  • Save KJlmfe/8346301 to your computer and use it in GitHub Desktop.

Select an option

Save KJlmfe/8346301 to your computer and use it in GitHub Desktop.

Revisions

  1. KJlmfe created this gist Jan 10, 2014.
    12 changes: 12 additions & 0 deletions sync_node.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    var fs = require('fs');
    //同步读取文件内容
    var data = fs.readFileSync('Hello.txt','utf-8');

    console.log(data);
    console.log('End');

    /*
    运行结果:
    Hello World
    End
    */