<commit_before>'use strict';
const map = require('map-stream');
const vfs = require('vinyl-fs');

const errHandler = function(err) {
  console.error(err);
  process.exit(1);
};

module.exports = (globs, pkg, customTemplate) => {
  vfs.src(globs)
    .on('error', errHandler)
    .pipe(map((file, cb) => {
      file.contents = new Buffer((typeof customTemplate === 'string' ? customTemplate :
`/**
 * ${pkg.name} v${pkg.version} ${pkg.homepage ? '(' + pkg.homepage + ')' : ''}
 * Copyright ${(new Date()).getFullYear()} ${pkg.author.name || ''} ${pkg.author.url ? '(' + pkg.author.url + ')' : ''}
${pkg.license ? ' * Licensed under ' + pkg.license + `\n */` : ` */`}
`) + file.contents);
      cb(null, file);
    }))
    .on('error', errHandler)
    .pipe(vfs.dest('./'))
    .on('error', errHandler);
};<commit_msg>handling of pkg without author info<commit_after>'use strict';
const map = require('map-stream');
const vfs = require('vinyl-fs');

const errHandler = function(err) {
  console.error(err);
  process.exit(1);
};

module.exports = (globs, pkg, customTemplate) => {
  vfs.src(globs)
    .on('error', errHandler)
    .pipe(map((file, cb) => {
      file.contents = new Buffer((typeof customTemplate === 'string' ? customTemplate :
`/**
 * ${pkg.name} v${pkg.version} ${pkg.homepage ? '(' + pkg.homepage + ')' : ''}
 * Copyright ${(new Date()).getFullYear()} ${pkg.author && pkg.author.name || ''} ${pkg.author && pkg.author.url ? '(' + pkg.author.url + ')' : ''}
${pkg.license ? ' * Licensed under ' + pkg.license + `\n */` : ` */`}
`) + file.contents);
      cb(null, file);
    }))
    .on('error', errHandler)
    .pipe(vfs.dest('./'))
    .on('error', errHandler);
};
{'fraction_non_alphanumeric': 0.24109263657957244, 'fraction_numerical': 0.0011876484560570072, 'mean_word_length': 3.629120879120879, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5114248', 'n_tokens_mistral': 600, 'n_tokens_neox': 585, 'n_words': 109}