<commit_before>var _     = require('lodash');
var map   = require('map-stream');
var pp    = require('preprocess');
var path  = require('path');

module.exports = function (context, options) {
  function ppStream(file, callback) {
    var contents, extension;

    // TODO: support streaming files
    if (file.isNull()) return callback(null, file); // pass along
    if (file.isStream()) return callback(new Error("gulp-preprocess: Streaming not supported"));

    context.NODE_ENV = context.NODE_ENV || 'development';
    contents = file.contents.toString('utf8');
    contents = pp.preprocess(contents, context, options);
    file.contents = new Buffer(contents);

    callback(null, file);
  }

  return map(ppStream);
};
<commit_msg>Remove NODE_ENV<commit_after>var _     = require('lodash');
var map   = require('map-stream');
var pp    = require('preprocess');
var path  = require('path');

module.exports = function (context, options) {
  function ppStream(file, callback) {
    var contents, extension;

    // TODO: support streaming files
    if (file.isNull()) return callback(null, file); // pass along
    if (file.isStream()) return callback(new Error("gulp-preprocess: Streaming not supported"));

    contents = file.contents.toString('utf8');
    contents = pp.preprocess(contents, context, options);
    file.contents = new Buffer(contents);

    callback(null, file);
  }

  return map(ppStream);
};

{'fraction_non_alphanumeric': 0.14366197183098592, 'fraction_numerical': 0.0014084507042253522, 'mean_word_length': 4.056939501779359, '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': '5459710', 'n_tokens_mistral': 417, 'n_tokens_neox': 405, 'n_words': 110}