regen js code