function render() {
  var terminalizer = $('#terminal').data('terminalizer');
  var framesCount = terminalizer.getFramesCount();

  // Foreach frame
  async.timesSeries(
    framesCount,
    function (frameIndex, next) {
      terminalizer._renderFrame(frameIndex, true, function () {
        capture(frameIndex, next);
      });
    },
    function (error) {
      if (error) {
        throw new Error(error);
      }

      app.close();
    }
  );
}
Render each frame and capture it