Loading ...
Sorry, an error occurred while loading the content.

Node.js problem

Expand Messages
  • Merlin
    This code: /*jslint nomen: true, node: true */ use strict ; var fs = require( fs ), path = require( path ); var JSLINT_PATH = path.join(__dirname,
    Message 1 of 2 , May 16, 2012
    • 0 Attachment
      This code:

      /*jslint nomen: true, node: true */
      "use strict";
      var fs = require("fs"), path = require("path");
      var JSLINT_PATH = path.join(__dirname, "jslint.js");
      var jslint = fs.readFileSync(JSLINT_PATH, "utf-8");

      produces error:

      Unexpected sync method: 'readFileSync'.
      var jslint = fs.readFileSync(JSLINT_PATH, "utf-8");

      The same occurs on both the current and test versions.
    • douglascrockford
      ... That is because you failed to specify option.stupid.
      Message 2 of 2 , May 16, 2012
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "Merlin" <g7awz@...> wrote:
        >
        > This code:
        >
        > /*jslint nomen: true, node: true */
        > "use strict";
        > var fs = require("fs"), path = require("path");
        > var JSLINT_PATH = path.join(__dirname, "jslint.js");
        > var jslint = fs.readFileSync(JSLINT_PATH, "utf-8");
        >
        > produces error:
        >
        > Unexpected sync method: 'readFileSync'.
        > var jslint = fs.readFileSync(JSLINT_PATH, "utf-8");
        >
        > The same occurs on both the current and test versions.

        That is because you failed to specify option.stupid.
      Your message has been successfully submitted and would be delivered to recipients shortly.