{"size": 923, "ext": "js", "max_stars_repo_path": "lib/ansi.js", "max_stars_repo_name": "EndangeredMassa/boxes", "max_stars_repo_stars_event_min_datetime": "2016-08-05T20:08:32.000Z", "max_stars_repo_stars_event_max_datetime": "2016-08-05T20:08:32.000Z", "max_issues_repo_path": "lib/ansi.js", "max_issues_repo_name": "EndangeredMassa/boxes", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/ansi.js", "max_forks_repo_name": "EndangeredMassa/boxes", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.3714285714, "max_line_length": 71, "alphanum_fraction": 0.5687973998}
// Generated by CoffeeScript 2.0.0-beta8
void function () {
  var clearFrom, Parser;
  Parser = require('../vendor/ansi_parse');
  clearFrom = function (history, position) {
    var lastLine, lines;
    lines = history.split('\n');
    lastLine = lines.pop();
    lastLine = lastLine.substr(0, position);
    lines.push(lastLine);
    return lines.join('\n');
  };
  module.exports = {
    parse: function (history, data) {
      var parser;
      parser = new Parser;
      parser.on('command', function (character, params, intermediate) {
        var param1;
        param1 = params[0];
        switch (character) {
        case 'H':
          return history = '';
        case 'J':
          return history = clearFrom(history, param1);
        }
      });
      parser.on('data', function (newData) {
        return history += newData;
      });
      parser.parse(data);
      return history;
    }
  };
}.call(this);
