@mustafa60x/gitpack 1.0.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +166 -35
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,76 +1,207 @@
1
- # Gitpack
1
+ # Gitpack 📦
2
2
 
3
- > Smart project packer that respects `.gitignore` or falls back to a sensible default exclusion list. Creates timestamped archives named after your package.
3
+ > Pack your project smartly. No more `node_modules` or `.git` folder clutter in your zips!
4
4
 
5
- ## Features
5
+ **Gitpack** creates a clean, timestamped archive of your project, respecting your `.gitignore` rules automatically.
6
6
 
7
- - **Smart Naming**:
8
- - Uses `name` and `version` from `package.json` if available (e.g., `app-v1.3.0-2026-02-09_153045.zip`)
9
- - Fallback to directory name + timestamp if `package.json` is missing.
10
- - ✅ **Git Aware**:
11
- - Uses `git ls-files` to include only tracked and non-ignored files.
12
- - ✅ **Multiple Formats**: Support for `.zip` and `.tar.gz`.
13
- - ✅ **Custom Output**: Control where your archive goes and what it includes.
7
+ ## Why Gitpack? 🚀
14
8
 
15
- ## Installation
9
+ Have you ever zipped your project to send it to someone, only to realize you included:
10
+ - ❌ The massive `node_modules` folders (100s of MBs)
11
+ - ❌ Sensitive `.env` files with API keys
12
+ - ❌ The huge `.git` history
13
+ - ❌ Temporary build artifacts (`dist`, `build`, etc.)
16
14
 
17
- You can run it directly with `npx`:
15
+ **Gitpack solves this** by intelligently selecting only tracked and non-ignored files, giving you production-ready archives every time.
16
+
17
+ ## Usage Scenarios 💡
18
+
19
+ - **Sharing Code:** Quickly send a clean source code zip to a colleague or friend.
20
+ - **Backups:** Create a "checkpoint" of your work before trying something experimental.
21
+ - **Assignments:** Submit your homework/project without unnecessary file bloat.
22
+ - **Archives:** Manually tag and archive versions of your app.
23
+
24
+ ## Installation 🛠️
25
+
26
+ ### npx (Recommended - No Installation)
27
+
28
+ You can run it directly with `npx`
18
29
 
19
30
  ```bash
20
31
  npx @mustafa60x/gitpack
21
32
  ```
22
33
 
23
- Or install it globally:
34
+ ### Global Installation
35
+
36
+ You can install it globally to use it from anywhere:
24
37
 
25
38
  ```bash
26
39
  npm install -g @mustafa60x/gitpack
27
40
  ```
28
41
 
29
- ## Usage
42
+ ### Project Dependency
43
+
44
+ Install it as a development dependency:
30
45
 
31
46
  ```bash
32
- gitpack [options]
47
+ npm install --save-dev @mustafa60x/gitpack
33
48
  ```
34
49
 
35
- ### Options
50
+ Then add to your `package.json` scripts:
36
51
 
37
- | Flag | Description | Default |
38
- |------|-------------|---------|
39
- | `--format <type>` | Archive format (`zip` or `tar`). | `zip` |
40
- | `--out <path>` | Specify output directory. | `../` (Parent directory) |
41
- | `--include-env` | Include `.env` files (only in fallback mode). | `false` |
42
- | `--no-git` | Force fallback mode (ignore `.git` data). | `false` |
52
+ ```json
53
+ {
54
+ "scripts": {
55
+ "pack": "gitpack",
56
+ "pack:tar": "gitpack --format tar --out ./backups",
57
+ "backup": "gitpack --out ./backups"
58
+ }
59
+ }
60
+ ```
43
61
 
44
- ### Examples
45
62
 
46
- **Standard Zip (Parent Directory)**
63
+ Now run with:
47
64
  ```bash
65
+ npm run backup
66
+ ```
67
+
68
+ ## Requirements 📋
69
+
70
+ - **Node.js**: v14 or higher
71
+ - **Git**: Recommended (for smart tracking features), but not required.
72
+
73
+ ## Features ✨
74
+
75
+ - 🎯 **Git-Aware Packing**: Uses git ls-files to include only tracked files
76
+ - 📛 **Smart Naming**: Auto-generates names from package.json (e.g., myapp-v1.3.0-2026-02-09_153045.zip)
77
+ - 🗜️ **Multiple Formats**: Support for .zip and .tar.gz
78
+ - 🎨 **Custom Output**: Control where archives go and what they include
79
+ - ⚡ **Zero Config**: Works out of the box with sensible defaults
80
+
81
+ ## Usage Examples 🚀
82
+
83
+ ### Basic Usage
84
+
85
+ Create a zip archive of your project:
86
+
87
+ ```bash
88
+ # Create a zip in parent directory
48
89
  gitpack
90
+
91
+ # Create a tar.gz archive
92
+ gitpack --format tar
49
93
  ```
50
94
 
51
- **Custom Output to a 'backups' folder**
95
+ ### Custom Output Directory
96
+
97
+ Specify a different directory for the archive:
98
+
52
99
  ```bash
100
+ # Save to specific folder
53
101
  gitpack --out ./backups
102
+
103
+ # Save to current directory
104
+ gitpack --out .
54
105
  ```
55
106
 
56
- **Generate a .tar.gz file**
107
+ ### Different Archive Format
108
+
109
+ Create a tar.gz archive instead of a zip:
110
+
57
111
  ```bash
58
112
  gitpack --format tar
59
113
  ```
60
114
 
61
- **Force fallback mode and include .env files**
115
+ ### Include .env Files
116
+
117
+ Include .env files in the archive (use with caution!):
118
+
119
+ ```bash
120
+ gitpack --include-env
121
+ ```
122
+
123
+ ### No Git Data
124
+
125
+ Force fallback mode and exclude .git data:
126
+
62
127
  ```bash
63
- gitpack --no-git --include-env
128
+ gitpack --no-git
129
+ ```
130
+
131
+ ### Advanced Usage
132
+
133
+ Combine multiple options for custom backups:
134
+
135
+ ```bash
136
+ # Create a timestamped backup in a specific directory
137
+ gitpack --out ./backups --format tar
138
+
139
+ # Create a clean archive without .git data
140
+ gitpack --no-git --out ./clean-backup
64
141
  ```
65
142
 
66
- ## Output Table
143
+ ## Output Example 📂
67
144
 
68
- | Scenario | `package.json` | Example Result |
69
- |----------|---------------|-----------------|
70
- | **Standard Zip** | `name: "app"`, `v1.3.0` | `app-v1.3.0-2026-02-09_032045.zip` |
71
- | **Tar Mode** | `name: "app"` | `app-2026-02-09_032045.tar.gz` |
72
- | **No Package** | (missing) | `folder_name-2026-02-09_032045.zip` |
145
+ Imagine your project structure:
73
146
 
74
- ## License
147
+ ```
148
+ my-app/
149
+ ├── node_modules/ (ignored)
150
+ ├── dist/ (ignored)
151
+ ├── src/
152
+ ├── package.json
153
+ └── README.md
154
+ ```
155
+
156
+ Running `gitpack` produces:
157
+
158
+ ```
159
+ 📦 my-app-v1.0.0-2024-03-20_140000.zip (Contains only src, package.json, README.md)
160
+ ```
161
+
162
+ ## CLI Options ⚙️
163
+
164
+ | Flag | Description | Default |
165
+ |------|-------------|---------|
166
+ | `--format <type>` | Archive format (`zip` or `tar`). | `zip` |
167
+ | `--out <path>` | Specify output directory. | `../` (Parent directory) |
168
+ | `--include-env` | Include `.env` files (only in fallback mode). | `false` |
169
+ | `--no-git` | Force fallback mode (ignore `.git` data). | `false` |
170
+
171
+ ## Naming Convention 🏷️
172
+
173
+ | Scenario | package.json | Output Name |
174
+ |----------|--------------|-------------|
175
+ | **Standard zip** | `name: "app", version: "1.3.0"` | `app-v1.3.0-2026-02-09_153045.zip` |
176
+ | **Tar format** | `name: "app", version: "2.0.1"` | `app-v2.0.1-2026-02-09_153045.tar.gz` |
177
+ | **Missing package.json** | `N/A` | `folder-name-2026-02-09_153045.zip` |
178
+ | **Missing version** | `name: "app" only` | `app-2026-02-09_153045.zip` |
179
+
180
+ ## Contributing 🤝
181
+
182
+ Contributions are welcome! If you find a bug or want to add a feature:
183
+
184
+ 1. Fork the repository
185
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
186
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
187
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
188
+ 5. Open a Pull Request
189
+
190
+ ## Support 🌟
191
+
192
+ If you find this project useful, please consider giving it a star on GitHub! It helps others discover the project and motivates me to keep improving it.
193
+
194
+ ## Connect 📬
195
+
196
+ If you have any questions or feedback, feel free to reach out:
197
+
198
+ - **GitHub:** [mustafa60x](https://github.com/mustafa60x)
199
+ - **Issues:** [Report a bug](https://github.com/mustafa60x/gitpack/issues)
200
+
201
+ ## License 📄
75
202
 
76
203
  MIT © [mustafa60x](https://github.com/mustafa60x)
204
+
205
+ <p align="center">
206
+ Made with ❤️ by <a href="https://github.com/mustafa60x">mustafa60x</a>
207
+ </p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mustafa60x/gitpack",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "overrides": {
5
5
  "glob": "^11.0.0"
6
6
  },