If it's just one file for a quick and dirty project, you might want to consider just searching for an online JS minification or compilation system, copy and paste at the end and you're done.
If you want something more advanced, well a lot of details depend on the project, but one consideration is to handle this at the start of your project by looking for some boilerplate website script that just handles minification and a few other common tasks, and starting off with that as the starting base for your project. Besides just Googling or searching Github, maybe Yeoman is a good place to look for something suitable like this.