Generate aggreagate js code with some paramters