difference niagara function script module script

I did look over all the lists of niagara features but one thing I am not sure about is differcnes between function script and module script. It seems like module script is something to do with customizing module but I have no idea with function script.