three js limit camera rotation to 180 degree horizontal

I am stuck at this puzzle I am not a 3d expert so this stuff is difficult for me.

Is there any example out there that is using three.js to route a camera using control and limit the rotation on the y-axis, by default is infinite?