<commit_before>'use strict';
var gutil = require('gulp-util');
var through = require('through2');
var PATHTOAXE = 'node_modules/axe-core/axe.min.js';

module.exports = function (options) {
	/*if (!options.foo) {
		throw new gutil.PluginError('gulp-axe-core', '`foo` required');
	}*/

	return through.obj(function (file, enc, cb) {
		if (file.isNull()) {
			cb(null, file);
			return;
		}

		if (file.isStream()) {
			cb(new gutil.PluginError('gulp-axe-core', 'Streaming not supported'));
			return;
		}

		try {
			file.contents = new Buffer(someModule(file.contents.toString(), options));
			this.push(file);
		} catch (err) {
			this.emit('error', new gutil.PluginError('gulp-axe-core', err));
		}

		cb();
	});
};
<commit_msg>feat(index.js): it uses context to load axe-core<commit_after>'use strict';
var gutil = require('gulp-util');
var vm = require('vm');
var fs = require('fs');
var through = require('through2');
/*var axe = require(__dirname + '/node_modules/axe-core/axe.min.js');*/

vm.runInThisContext(fs.readFileSync(__dirname + '/node_modules/axe-core/axe.js'))

module.exports = function (options) {
	/*if (!options.foo) {
		throw new gutil.PluginError('gulp-axe-core', '`foo` required');
	}*/

	return through.obj(function (file, enc, cb) {
		if (file.isNull()) {
			cb(null, file);
			return;
		}
		if (file.isStream()) {
			cb(new gutil.PluginError('gulp-axe-core', 'Streaming not supported'));
			return;
		}

		try {
			file.contents = new Buffer(axe.a11yCheck(file.contents.toString(), options));
			this.push(file);

		} catch (err) {
			this.emit('error', new gutil.PluginError('gulp-axe-core', err));
		}

		cb();
	});
};

{'fraction_non_alphanumeric': 0.1955069823922283, 'fraction_numerical': 0.0024286581663630845, 'mean_word_length': 4.0552147239263805, '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': '1473515', 'n_tokens_mistral': 661, 'n_tokens_neox': 602, 'n_words': 119}