<commit_before>var Dependency = module.exports.Dependency = require('./lib/Dependency.js')
var Injector = module.exports.Injector = require('./lib/Injector.js');
var packageJson = require('./package.json')

var injector

module.exports.Injector = Injector
module.exports.inject = inject
module.exports.version = packageJson.version

function inject(file, overrides) {
	if (!injector) {
		injector = newInjector(overrides)
	}

	if (typeof file === 'string')
		file = require(file)
	else if (typeof file !== 'function')
		throw new Error('invalid parameter, must provide a filename or a function')

	injector.inject(file)

	return injector
}

function newInjector(overrides) {
	var injector = new Injector()

	for (var name in overrides) {
		var dep = new Dependency(name)

		if (typeof overrides[name] === 'string')
			dep.requireId = overrides[name]
		else
			dep.object = overrides[name]

		injector.addDependency(dep)
	}

	return injector
}
<commit_msg>expose callback in module public api<commit_after>var Dependency = module.exports.Dependency = require('./lib/Dependency.js')
var Injector = module.exports.Injector = require('./lib/Injector.js');
var packageJson = require('./package.json')

var injector

module.exports.Injector = Injector
module.exports.inject = inject
module.exports.version = packageJson.version

function inject(file, overrides, callback) {

	if (typeof overrides === 'function') {
		callback === overrides
		overrides === undefined
	}

	if (!injector) {
		injector = newInjector(overrides)
	}

	if (typeof file === 'string')
		file = require(file)
	else if (typeof file !== 'function')
		throw new Error('invalid parameter, must provide a filename or a function')

	injector.inject(file, callback)

	return injector
}

function newInjector(overrides) {
	var injector = new Injector()

	for (var name in overrides) {
		var dep = new Dependency(name)

		if (typeof overrides[name] === 'string')
			dep.requireId = overrides[name]
		else
			dep.object = overrides[name]

		injector.addDependency(dep)
	}

	return injector
}

{'fraction_non_alphanumeric': 0.12347486578818936, 'fraction_numerical': 0.0, 'mean_word_length': 4.555555555555555, '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': '1703809', 'n_tokens_mistral': 674, 'n_tokens_neox': 644, 'n_words': 171}