An promise for javascript