tail -f implementation in goold old javascript