@nka212bg/backend-utils 0.1.35 → 0.1.36

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.
package/README.md CHANGED
File without changes
package/db/dbUtils.js CHANGED
File without changes
package/db/mysql2.js CHANGED
File without changes
package/db/sqlite3.js CHANGED
File without changes
package/index.js CHANGED
File without changes
File without changes
File without changes
package/location/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
package/markdown/index.js CHANGED
File without changes
File without changes
package/misc.js CHANGED
@@ -1,4 +1,5 @@
1
1
  const { existsSync, mkdirSync, readdirSync, readFileSync, readFile, statSync, copyFile, copyFileSync, unlink, unlinkSync, rmdirSync, lstatSync } = require("fs");
2
+ const { IncomingForm } = require("formidable");
2
3
  const sharp = require("sharp");
3
4
 
4
5
  exports.slugFormatter = (text) => {
@@ -150,6 +151,13 @@ exports.fileServe = ({ filePath, res, download, img } = {}) => {
150
151
  });
151
152
  };
152
153
 
154
+ exports.incomingForm = (req) => {
155
+ return new Promise((resolve) => {
156
+ if (!req.is("multipart/form-data")) return resolve(["", req.body, ""]);
157
+ new IncomingForm().parse(req, (err, fields, files) => resolve([err, fields, files]));
158
+ });
159
+ };
160
+
153
161
  // { file: files[file], writePath: imagePath, width: 200, height: 200, type: "jpeg" }
154
162
  exports.saveImage = ({ file, writePath, width, height, loop = 0, quality = 85, maxSize = 200, type }) => {
155
163
  file.sizeKb = file.size / 1000;
package/os.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@nka212bg/backend-utils",
3
3
  "author": "nka212bg",
4
- "version": "0.1.35",
4
+ "version": "0.1.36",
5
5
  "main": "index.js",
6
6
  "dependencies": {
7
7
  "@maxmind/geoip2-node": "^5.0.0",
8
8
  "systeminformation": "^5.21.24",
9
- "adm-zip": "^0.5.16",
9
+ "formidable": "^2.1.5",
10
10
  "nodemailer": "^8.0.8",
11
+ "adm-zip": "^0.5.16",
11
12
  "os-utils": "^0.0.14",
12
13
  "stripe": "^14.23.0",
13
14
  "mysql2": "^3.11.0",
@@ -15,4 +16,4 @@
15
16
  "sharp": "^0.33.5",
16
17
  "ws": "^7.3.0"
17
18
  }
18
- }
19
+ }
package/session.js CHANGED
File without changes
package/socket.js CHANGED
File without changes
package/stripe.js CHANGED
File without changes
package/systemLog.js CHANGED
File without changes