Count elements by xpath

Hello,

Is there a way to count elements by xpath using Javascript or Groovy with appium? I use a framework to build the tests (https://www.cerberus-testing.org/index.php/en/)

Thanks in advance,