Then, the code is quite easy:
Just use the analogRead(PIN) function with the correct pin name and there it is. Then you can add some threshold or whatever you want depending on your application
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
There is big chances the moisture sensor is analog, like the one from Adafruit (https://www.sparkfun.com/products/13322).
Then, the code is quite easy:
Just use the
analogRead(PIN)
function with the correct pin name and there it is. Then you can add some threshold or whatever you want depending on your application