This is the shell script that I use to setup my machine. It installs homebrew, Git and nvm. Then it downloads and uses the latest Node.js LTS version and sets that as a default. Then it sets my Git global config with my name and email address.
I could make use of environment variables for the values that are variable such as my name and email address.