javascript read file if exists