title: Node script ReferenceError: fs is not defined error in test script
body: <p>I am trying out node to run a simple js script to read a file,
  following is the content of my script:</p>
  
  <pre><code>"use strict"
  fs = require('fs');
  var args = process.argv.slice(2);
  fs.readFile(args, 'utf8', function (err,data) {
    if (err) {
        return console.log(err);
          }
      console.log("Reading from file " + args);
      console.log(data);
  });
  </code></pre>
  
  <p>when I try to run this using the following command:
  node myTestFile.js testFile</p>
  
  <p>I get this error:</p>
  
  <pre><code>fs = require('fs');
     ^
  ReferenceError: fs is not defined
      at Object.&lt;anonymous&gt;     (/&lt;Path to file&gt;/myTestFile.js:2:4)
  at Module._compile (module.js:570:32)
  at Object.Module._extensions..js (module.js:579:10)
  at Module.load (module.js:487:32)
  at tryModuleLoad (module.js:446:12)
  at Function.Module._load (module.js:438:3)
  at Module.runMain (module.js:604:10)
  at run (bootstrap_node.js:393:7)
  at startup (bootstrap_node.js:150:9)
  at bootstrap_node.js:508:3
  </code></pre>
  
  <p>Isn't fs in node like a library like stdio in c ?</p>
  
  <p>Do we have to explicitly define the library path somewhere in node ?</p>
  
  <p>How can I get the above example to work ?</p>