'use strict';

var _stringify = require('babel-runtime/core-js/json/stringify');

var _stringify2 = _interopRequireDefault(_stringify);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var gff = require('../dist').default;

var itemBuffer = void 0;

process.stdout.write('[\n');
process.stdin.pipe(gff.parseStream({ parseAll: true })).on('data', function (item) {
  itemBuffer = (0, _stringify2.default)(item);
  if (itemBuffer) {
    process.stdout.write(itemBuffer);
    process.stdout.write(',\n');
  }
}).on('error', function (err) {
  console.error(err);
  process.exit(1);
}).on('end', function () {
  if (itemBuffer) {
    process.stdout.write(itemBuffer);
  }
  process.stdout.write('\n]\n');
});