javascript check if file exists in directory