javascript promise built on top of findhit-class