added javascript main export function

Signed-off-by: Fred Wen <fred.wen@gov.bc.ca>