<commit_before>var fs = require("fs");
//
// var foo = {
//   "foo": "bar",
//   "bar": function() {
//     this.foo = "hello";
//     this[foo] = "bar";
//     this["foo"] = "bar";
//     this.setProperty("foo", "bar");
//   }
// };
//
// foo.prototype = {
//
// };
//
// Foo = function() {
//   this.foo = "bar";
//   this.bar = function() {
//
//   };
// };
//
// Foo.prototype = {
//   foo: "hello",
//   bar: function() {
//
//   }
// };
//
// var f = new Foo();
// f.foo = "hello";
// f.bar();

try {
  var stats = fs.statSync("/usr/local/inversoft/config/config-production.json");
} catch(err) {
  //goes to dev mode
}
var config = "";
if (stats && stats.isFile()) {
  config = require("/usr/local/inversoft/config/config-production.json");
} else {
  config = require("./config-dev.json");
}

for (var property in config) {
  if (config.hasOwnProperty(property)) {
    module.exports[property] = config[property];
  }
}<commit_msg>Added comments and reworked the config loader<commit_after>var fs = require("fs");

/**
 * This module loads a configuration files. It defaults to loading the config-dev.json in the current directory.
 * However, it also checks if the file <code>/usr/local/inversoft/config/config-production.json</code> exists and if
 * it does, it loads that file instead.
 *
 * This is useful for production environments because you don't check in things like the database username and password
 * into source control. You can also lock down the production file on the file system so that only the application can
 * read it.
 */
var config = require("./config-dev.json");
try {
  var stats = fs.statSync("/usr/local/inversoft/config/config-production.json");
  if (stats.isFile()) {
    config = require("/usr/local/inversoft/config/config-production.json");
  }
} catch (err) {
  // Already initialized to a good value, ignoring the exception for now
}

for (var property in config) {
  if (config.hasOwnProperty(property)) {
    module.exports[property] = config[property];
  }
}
{'fraction_non_alphanumeric': 0.17937219730941703, 'fraction_numerical': 0.0, 'mean_word_length': 3.007984031936128, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1842707', 'n_tokens_mistral': 644, 'n_tokens_neox': 638, 'n_words': 181}