@abtnode/util 1.16.30-beta-2876881d → 1.16.30-beta-cd65989e
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/lib/get-folder-size.js +4 -18
- package/package.json +11 -10
package/lib/get-folder-size.js
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
|
+
const fastFolderSize = require('fast-folder-size');
|
|
2
|
+
const { promisify } = require('util');
|
|
1
3
|
const getSize = require('get-folder-size');
|
|
2
|
-
const exec = require('child_process').execFile;
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
-
const regex = /^(\d*)/;
|
|
6
|
-
|
|
7
|
-
return new Promise((resolve, reject) => {
|
|
8
|
-
exec('du', ['-ks', dir], (err, stdout, stderr) => {
|
|
9
|
-
const matches = stdout.match(regex);
|
|
10
|
-
const kbytes = matches[1];
|
|
11
|
-
const bytes = kbytes * 1024;
|
|
12
|
-
if (!err && !stderr && matches && matches.length > 1) {
|
|
13
|
-
resolve(bytes);
|
|
14
|
-
} else {
|
|
15
|
-
reject(err, stderr, stdout);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
};
|
|
5
|
+
const fastFolderSizeAsync = promisify(fastFolderSize);
|
|
20
6
|
|
|
21
7
|
const getOnWindows = (dir) => {
|
|
22
8
|
return new Promise((resolve, reject) => {
|
|
@@ -30,4 +16,4 @@ const getOnWindows = (dir) => {
|
|
|
30
16
|
});
|
|
31
17
|
};
|
|
32
18
|
|
|
33
|
-
module.exports = process.platform === 'win32' ? getOnWindows :
|
|
19
|
+
module.exports = process.platform === 'win32' ? getOnWindows : fastFolderSizeAsync;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.30-beta-
|
|
6
|
+
"version": "1.16.30-beta-cd65989e",
|
|
7
7
|
"description": "ArcBlock's JavaScript utility",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
"author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
|
|
19
19
|
"license": "Apache-2.0",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@abtnode/constant": "1.16.30-beta-
|
|
22
|
-
"@abtnode/logger": "1.16.30-beta-
|
|
21
|
+
"@abtnode/constant": "1.16.30-beta-cd65989e",
|
|
22
|
+
"@abtnode/logger": "1.16.30-beta-cd65989e",
|
|
23
23
|
"@arcblock/pm2": "^5.4.0",
|
|
24
|
-
"@blocklet/constant": "1.16.30-beta-
|
|
25
|
-
"@blocklet/meta": "1.16.30-beta-
|
|
26
|
-
"@ocap/client": "1.18.
|
|
27
|
-
"@ocap/mcrypto": "1.18.
|
|
28
|
-
"@ocap/util": "1.18.
|
|
29
|
-
"@ocap/wallet": "1.18.
|
|
24
|
+
"@blocklet/constant": "1.16.30-beta-cd65989e",
|
|
25
|
+
"@blocklet/meta": "1.16.30-beta-cd65989e",
|
|
26
|
+
"@ocap/client": "1.18.131",
|
|
27
|
+
"@ocap/mcrypto": "1.18.131",
|
|
28
|
+
"@ocap/util": "1.18.131",
|
|
29
|
+
"@ocap/wallet": "1.18.131",
|
|
30
30
|
"archiver": "^7.0.1",
|
|
31
31
|
"axios": "^1.7.2",
|
|
32
32
|
"axios-mock-adapter": "^1.21.2",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"cross-spawn": "^7.0.3",
|
|
38
38
|
"dayjs": "^1.11.8",
|
|
39
39
|
"debug": "^4.3.4",
|
|
40
|
+
"fast-folder-size": "^2.2.0",
|
|
40
41
|
"fast-glob": "^3.3.2",
|
|
41
42
|
"find-up": "^5.0.0",
|
|
42
43
|
"fkill": "^7.2.1",
|
|
@@ -81,5 +82,5 @@
|
|
|
81
82
|
"fs-extra": "^11.2.0",
|
|
82
83
|
"jest": "^29.7.0"
|
|
83
84
|
},
|
|
84
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "8646768b8ac83cdb8c213ab17fe8030f3d5dc6fc"
|
|
85
86
|
}
|