{"size": 1086, "ext": "js", "max_stars_repo_path": "example3.js", "max_stars_repo_name": "sajonoso/fsxcl", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "example3.js", "max_issues_repo_name": "sajonoso/fsxcl", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "example3.js", "max_forks_repo_name": "sajonoso/fsxcl", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.6818181818, "max_line_length": 92, "alphanum_fraction": 0.5985267035}
require = typeof (require) === 'function' ? require : function (file) {
  var fh = (new ActiveXObject("Scripting.FileSystemObject")).OpenTextFile(file + '.js', 1);
  var content = fh.ReadAll(); fh.close(); eval(content); return fs;
}
require('./fsxcl');


var TEST_FOLDER = 'my_folder';
var TEST_FILE = 'testdata.txt';


// *** Create a text file
var fdOut = fs.openSync(TEST_FILE, 'w');
for (var j = 0; j < 100; j++) {
  fs.writeSync(fdOut, 'This is line number ' + j + '\n');
};
fs.closeSync(fdOut);


// *** Read a text file
if (fs.existsSync(TEST_FILE)) {
  fdIn = fs.openSync(TEST_FILE, 'r');
  var i = 0
  ReadLine(fs, fdIn, function (text) {
    console.log((++i) + ' ' + text);
    if (i == 10) return true;
  });
  fs.closeSync(fdIn);
};

if (!fs.existsSync(TEST_FOLDER)) {
  fs.mkdirSync(TEST_FOLDER);
};

// *** Make a folder
MakeFullPath(fs, "this/is/a/folder");

// *** Read a whole file into a string
var tst = fs.readFileSync(TEST_FILE, 'utf-8');
// console.log(tst);

// *** Wait for user input
ReadInput(function (text) { });
