Solved !!
While creating job using pub/sub subscription to Bigquery template, click on see option parameters. Where we can set .js file path and UDF function name.
Here is the JS code for transformation i.e, from CSV format to JSON format.
function transform(messages) {
var values = messages.split(',');
// Construct output and add transformations
var obj = new Object();
obj.SNo = values[0];
var dateObj = values[1];
// Date format in file is dd/mm/YYYY
// Transform the field to Date format required for BigQuery that is YYYY-mm-dd
obj.ObservationDate = dateObj.replace(/(\d\d)\/(\d\d)\/(\d{4})/, "$3-$1-$2");
obj.Provision_State = values[2];
obj.Country_Region = values[3];
obj.Last_Update = values[4];
obj.Confirmed = values[5];
obj.Deaths = values[6];
obj.Recovered = values[7];
// add object to JSON
var jsonString = JSON.stringify(obj);
return jsonString;
}