<commit_before>var Transform = require('stream').Transform;
var util = require('util');

util.inherits(Fixated, Transform);

function Fixated(format, opt) {
  if (!(this instanceof Fixated)) {    
    return new Fixated(format, opt);
  }

  opt = opt || {};
  opt.writableObjectMode = true;
  opt.readableObjectMode = false;
  opt.fillChar = opt.fillChar || ' ';

  this._options = opt;

  Transform.call(this, opt);
  this._format = format;

  var lineSize = 0;
  Object.keys(this._format).forEach(function(key) {
    lineSize += format[key];
  });

  lineSize += 2; // \r\n 

  this._lineSize = lineSize;

}

Fixated.prototype._transform = function (data, encoding, callback) {
  var line = new Buffer(this._lineSize);

  // fill the buffer with spaces
  line.fill(this._options.fillChar);

  // place new line
  line.write('\r\n', this._lineSize - 2, 'ascii');

  var convert = this._options.convert;

  var offset = 0;
  var format = this._format;
  var rightAlignment = this._options.rightAlignment;<commit_msg>Contribution by @	jobe451 added configurable row delimiter<commit_after>var Transform = require('stream').Transform;
var util = require('util');

util.inherits(Fixated, Transform);

function Fixated(format, opt) {
  if (!(this instanceof Fixated)) {    
    return new Fixated(format, opt);
  }

  opt = opt || {};
  opt.writableObjectMode = true;
  opt.readableObjectMode = false;
  opt.fillChar = opt.fillChar || ' ';
  this._rowDelimiter  = opt.rowDelimiter || require('os').EOL;

  this._options = opt;

  Transform.call(this, opt);
  this._format = format;

  var lineSize = 0;
  Object.keys(this._format).forEach(function(key) {
    lineSize += format[key];
  });

  lineSize += this._rowDelimiter.length;

  this._lineSize = lineSize;

}

Fixated.prototype._transform = function (data, encoding, callback) {
  var line = new Buffer(this._lineSize);

  // fill the buffer with spaces
  line.fill(this._options.fillChar);

  // place new line
  line.write(this._rowDelimiter, this._lineSize - this._rowDelimiter.length, 'ascii');

  var convert = this._options.convert;

  var offset = 0;
  var format = this._format;
  var rightAlignment = this._options.rightAlignment;
{'fraction_non_alphanumeric': 0.13829301688726608, 'fraction_numerical': 0.004107713372889092, 'mean_word_length': 3.7964989059080962, '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': '4454956', 'n_tokens_mistral': 729, 'n_tokens_neox': 693, 'n_words': 163}