<commit_before>import fs from 'fs';
import _  from 'underscore';

// set template interpolation wrapper to {{}}
_.templateSettings = {
	interpolate: /\{\{(.+?)\}\}/g
};

// generate object of template methods
let templates = {};
let files = fs.readdirSync(__dirname);
for (let file of files) {
	if (file.indexOf('.html') > -1) {
		let tplName = file.slice(0, file.indexOf('.html'));
		let tpl = fs.readFileSync(__dirname + '/' + file).toString('utf-8');
		templates[tplName] = _.template(tpl);
	}
}

export default templates;<commit_msg>Added juice for automatic style inlining on email templates<commit_after>import fs    from 'fs';
import _     from 'underscore';
import juice from 'juice';

// set template interpolation wrapper to {{}}
_.templateSettings = {
	interpolate: /\{\{(.+?)\}\}/g
};

// generate object of template methods
let templates = {};
let files = fs.readdirSync(__dirname);
for (let file of files) {
	if (file.indexOf('.html') > -1) {
		let tplName = file.slice(0, file.indexOf('.html'));
		let tpl = fs.readFileSync(__dirname + '/' + file).toString('utf-8');
		// inline styles
		tpl = juice(tpl);
		// convert to underscore template
		templates[tplName] = _.template(tpl);
	}
}

export default templates;
{'fraction_non_alphanumeric': 0.17019543973941367, 'fraction_numerical': 0.004885993485342019, 'mean_word_length': 3.9959349593495936, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4096015', 'n_tokens_mistral': 402, 'n_tokens_neox': 390, 'n_words': 111}