code: function measure(ref) {
      return new Promise(function (resolve) {
        ref.measure(function (x, y, width, height, pageX, pageY) {
          resolve({
            x: pageX,
            y: pageY,
            width: width,
            height: height
          });
        });
      });
    }
docs: Promisifies measure's callback function and returns layout object.