nms-zip v1.1.1
nms-zip
A simple npm package to create a zip backup of your current working directory, excluding node_modules by default and allowing custom exclusions. Perfect for developers who want a quick way to snapshot their project and avoid losing work!
Features
Creates a zip file of the current directory with the format backup-YYYYMMDD.zip (e.g., backup-20250219.zip). Automatically excludes node_modules to keep the zip lightweight. Supports custom exclusions via command-line flags (e.g., --dist to exclude the dist folder). Overwrites the previous zip file when run again . Built with Node.js—no extra dependencies needed beyond npm.
Installation
Install globally to use it anywhere:
npm install -g nms-zip
Or install locally in a project:
npm install nms-zip
Usage
Run the following commands in your terminal from the directory you want to back up.
Basic Backup
Create a zip of the current directory, excluding node_modules:
nms-zip start if you have installed globally otherwise use npx nms-zip start.
This generates a file like backup-20250219.zip. If you run it again , it overwrites the previous zip with the updated contents.
Custom Exclusions
Exclude additional files or folders by adding -- flags:
nms-zip start --dist --logs This excludes node_modules, dist, and logs from the zip.
Example Output
$ nms-zip start --dist Creating backup-20250219.zip... Excluding: 'node_modules', 'backup-20250219.zip', 'dist' backup-20250219.zip created successfully (12345 bytes)
How It Works
The zip file is named with the current date (e.g., backup-20250219.zip for February 19, 2025). node_modules and the output zip file itself are always excluded. Custom exclusions are added dynamically via -- flags. Running the command again on the same day replaces the old zip with a new one containing the latest files.
Requirements
Node.js (v12 or higher recommended). npm (comes with Node.js).
License
MIT © Sk Rafikul Islam
Author
Sk Rafikul Islam
Full Stack Developer
Email: rafikul.career@gmail.com