Have you ever needed to move a node application quickly without much hassle? Some of the most fun and rewarding code I have wrote is the automation of code deployment across environments via Chat Ops. There is something extremely satisfying about being able to say deploy dev myRepo and watching your workers do their thing.
So while there is certainly a need to create a deployment process, sometimes you just need a quick solution to move code from one place to another. I feel that this is an excellent time to use an application like 7-Zip to help us achieve this simple task.
Fire up PowerShell or CMD and execute the following (changing the filepath of course).
What is happening
- 7z.exe - This is the actual executable of the 7-Zip application that we need to call
- a - This command stands for “archive” or “add.” Use it to put files in an archive
- -tzip - Determines the format that we would like our output file (ZIP)
- C:\node\myApplication - The folder we want to target and zip
- -xr!node_modules - The “x” tell 7-Zip to exclude “r” recursively “!” the following files/folders…and in this instance we do not need to package our node_modules and take them with us.
For more information on 7-Zip Command Line
After running this command you will have a very fast and efficient way of zipping up your application(s) and be able to move them easily. I hope this helps you spend less time moving things and more time coding =)