Fully function build script...in javascript