<commit_before>var fs = require('q-io/fs'),
		Q  = require('q');

module.exports = function(file){
	this.readCredentialFile = fs.read(file),
	this.listOfRegisteredEnvVars = [];
}

module.exports.prototype.register = function(name, obj){
	this[name] = this.readCredentialFile.then(function(creds){
		creds = JSON.parse(creds);
		var t = new obj(creds[name]);
		t.patch = function(name, func){
			t['_'+name] = t[name];
			t[name] = func;
		}
		t._options = creds[name];
		return t
	});
	this.listOfRegisteredEnvVars.push(name);
	return this[name];
}

module.exports.prototype.loaded = function(injectors){
	return Q.all(injectors||this.listOfRegisteredEnvVars);
}<commit_msg>adding more automated way to start a configuration environment<commit_after>var fs = require('q-io/fs'),
		Q  = require('q')
    configen
    ;

function configen(file){
	this.readCredentialFile = fs.read(file),
	this.listOfRegisteredEnvVars = [];
}

configen.prototype.register = function(name, obj){
	this[name] = this.readCredentialFile.then(function(creds){
		creds = JSON.parse(creds);
		var t = new obj(creds[name]);
		t.patch = function(name, func){
			t['_'+name] = t[name];
			t[name] = func;
		}
		t._options = creds[name];
		return t
	});
	this.listOfRegisteredEnvVars.push(name);
	return this[name];
}

configen.prototype.loaded = function(injectors){
	return Q.all(injectors||this.listOfRegisteredEnvVars);
}

configen.generate = function(file){
  return new configen(file);
}

module.exports = configen;
{'fraction_non_alphanumeric': 0.15828303152246814, 'fraction_numerical': 0.0, 'mean_word_length': 4.944223107569721, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '853999', 'n_tokens_mistral': 553, 'n_tokens_neox': 535, 'n_words': 94}