<commit_before>#!/usr/bin/env node
// ---------------------------------------------------------------------------------------------------------------------
// This script is intended to execute all unit tests in the Chrome Browser.
// ---------------------------------------------------------------------------------------------------------------------
/* eslint-env node, es6 */

require('shelljs/global');

var _ = require('lodash'),
    async = require('async'),
    fs = require('fs'),
    chalk = require('chalk'),
    Bundle = require('../lib/bundle'),

    createBundle;

createBundle = function (options, file, done) {
    async.waterfall([
        function (next) {
            Bundle.load(options).compile(next);
        },

        function (buf, next) {
            fs.writeFile(file, `module.exports=function(d){d(null, new Buffer(${JSON.stringify(buf)}.data));};`, next);
        },

        function (next) {
            console.log(` - ${file}`);
            next();
        }
    ], done);
};

module.exports = function (exit) {
    mkdir('-p', '.cache'); // create a cache directory in any case

    if (_.get(process, 'argv[2]') === 'clear') {
        rm('-rf', '.cache');

        console.log('cache cleared - ".cache/*"');
        exit();
    }
<commit_msg>Store bootcode as base64 string<commit_after>#!/usr/bin/env node
// ---------------------------------------------------------------------------------------------------------------------
// This script is intended to execute all unit tests in the Chrome Browser.
// ---------------------------------------------------------------------------------------------------------------------
/* eslint-env node, es6 */

require('shelljs/global');

var _ = require('lodash'),
    async = require('async'),
    fs = require('fs'),
    chalk = require('chalk'),
    Bundle = require('../lib/bundle'),

    createBundle;

createBundle = function (options, file, done) {
    async.waterfall([
        function (next) {
            Bundle.load(options).compile(next);
        },

        function (buf, next) {
            // eslint-disable-next-line max-len
            fs.writeFile(file, `module.exports=function(d){d(null,Buffer.from('${buf.toString('base64')}','base64'));};`, next);
        },

        function (next) {
            console.log(` - ${file}`);
            next();
        }
    ], done);
};

module.exports = function (exit) {
    mkdir('-p', '.cache'); // create a cache directory in any case

    if (_.get(process, 'argv[2]') === 'clear') {
        rm('-rf', '.cache');

        console.log('cache cleared - ".cache/*"');
        exit();
    }

{'fraction_non_alphanumeric': 0.33409350057012543, 'fraction_numerical': 0.003800836183960471, 'mean_word_length': 1.35, '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': '1244187', 'n_tokens_mistral': 684, 'n_tokens_neox': 660, 'n_words': 154}