ngx-git 1.0.3 → 1.0.4

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/cli.js +10 -2
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -10,6 +10,7 @@ const fs = require("fs");
10
10
  const path = require("path");
11
11
  const http = require("http");
12
12
  const os = require("os");
13
+ const zlib = require("zlib");
13
14
 
14
15
  const axios = require("axios");
15
16
 
@@ -152,6 +153,8 @@ function collectFiles(folderPath) {
152
153
  walk(fullPath, relPath);
153
154
  } else if (entry.isFile()) {
154
155
  const buf = fs.readFileSync(fullPath);
156
+ const compressed = zlib.gzipSync(buf);
157
+
155
158
  // Skip binary files > 50 MB (GitHub limit)
156
159
  if (buf.length > 50 * 1024 * 1024) {
157
160
  console.log(
@@ -161,7 +164,12 @@ function collectFiles(folderPath) {
161
164
  );
162
165
  continue;
163
166
  }
164
- files.push({ path: relPath, content_b64: buf.toString("base64") });
167
+
168
+ files.push({
169
+ path: relPath,
170
+ content_b64: compressed.toString("base64"),
171
+ compressed: true,
172
+ });
165
173
  }
166
174
  }
167
175
  }
@@ -636,7 +644,7 @@ ${C.cyan("Config:")}
636
644
  ngx -v Show version
637
645
 
638
646
  ${C.grey("Auto-ignored on push:")}
639
- ${C.grey(".env node_modules .git dist build *.key *.pem secrets")}
647
+ ${C.grey(".env node_modules .git build *.key *.pem secrets")}
640
648
  ${C.grey("Add extras in .ngxignore or .gitignore")}
641
649
  `);
642
650
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-git",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "NGX - Minimal GitHub-like server",
5
5
  "main": "server.js",
6
6
  "bin": {