feat(js): implemented promises