code: function CheckpointPlugin () {
      if (!db.getDiskSize) {
        throw new Error(
          'This plugin depends on pouchdb-size plugin. ' +
          'Please add pouchdb-size plugin befor this one.'
        );
      }
  
      var changes = db.changes({
        live: true,
        since: 'now'
      })
        .on('error', function (error) {
          logger.error(
            'Error while fetching db changes: \'%s\', stack: \'%s\'',
            String(error), error.stack
          );
          changes.cancel();
          db.emit('error', error);
        })
        .on('change', executeOnce(checkDBSize, delay));
  
      db.on('destroyed', function () {
        destroyed = true;
        changes.cancel();
      });
    }
docs: Public constructor