@rsdoctor/utils 0.3.1 → 0.3.3
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.
|
@@ -27,6 +27,7 @@ __export(envinfo_exports, {
|
|
|
27
27
|
getNpmPackageVersion: () => getNpmPackageVersion,
|
|
28
28
|
getNpmVersion: () => getNpmVersion,
|
|
29
29
|
getOSInfo: () => getOSInfo,
|
|
30
|
+
getPnpmVersion: () => getPnpmVersion,
|
|
30
31
|
getYarnVersion: () => getYarnVersion
|
|
31
32
|
});
|
|
32
33
|
module.exports = __toCommonJS(envinfo_exports);
|
|
@@ -38,6 +39,7 @@ const getMemoryInfo = () => import_envinfo.helpers.getMemoryInfo().then((res) =>
|
|
|
38
39
|
const getNodeVersion = () => import_envinfo.helpers.getNodeInfo().then((res) => res[1]);
|
|
39
40
|
const getYarnVersion = () => import_envinfo.helpers.getYarnInfo().then((res) => res[1]);
|
|
40
41
|
const getNpmVersion = () => import_envinfo.helpers.getnpmInfo().then((res) => res[1]);
|
|
42
|
+
const getPnpmVersion = () => import_envinfo.helpers.getpnpmInfo().then((res) => res[1]);
|
|
41
43
|
function getNpmPackageVersion(pkg) {
|
|
42
44
|
const isArray = Array.isArray(pkg);
|
|
43
45
|
return (0, import_envinfo.run)(
|
|
@@ -102,5 +104,6 @@ function getGitRepo() {
|
|
|
102
104
|
getNpmPackageVersion,
|
|
103
105
|
getNpmVersion,
|
|
104
106
|
getOSInfo,
|
|
107
|
+
getPnpmVersion,
|
|
105
108
|
getYarnVersion
|
|
106
109
|
});
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var process_exports = {};
|
|
30
20
|
__export(process_exports, {
|
|
@@ -32,7 +22,7 @@ __export(process_exports, {
|
|
|
32
22
|
getMemoryUsageMessage: () => getMemoryUsageMessage
|
|
33
23
|
});
|
|
34
24
|
module.exports = __toCommonJS(process_exports);
|
|
35
|
-
var
|
|
25
|
+
var import_filesize = require("filesize");
|
|
36
26
|
var import_process = require("process");
|
|
37
27
|
function getMemoryUsage() {
|
|
38
28
|
return (0, import_process.memoryUsage)();
|
|
@@ -40,15 +30,15 @@ function getMemoryUsage() {
|
|
|
40
30
|
function getMemoryUsageMessage() {
|
|
41
31
|
const usage = getMemoryUsage();
|
|
42
32
|
const msgs = [
|
|
43
|
-
`RSS: ${(0,
|
|
44
|
-
`Heap Total: ${(0,
|
|
45
|
-
`Heap Used: ${(0,
|
|
33
|
+
`RSS: ${(0, import_filesize.filesize)(usage.rss)}`,
|
|
34
|
+
`Heap Total: ${(0, import_filesize.filesize)(usage.heapTotal)}`,
|
|
35
|
+
`Heap Used: ${(0, import_filesize.filesize)(usage.heapUsed)}`
|
|
46
36
|
];
|
|
47
37
|
if (usage.arrayBuffers) {
|
|
48
|
-
msgs.push(`ArrayBuffers: ${(0,
|
|
38
|
+
msgs.push(`ArrayBuffers: ${(0, import_filesize.filesize)(usage.arrayBuffers)}`);
|
|
49
39
|
}
|
|
50
40
|
if (usage.external) {
|
|
51
|
-
msgs.push(`External: ${(0,
|
|
41
|
+
msgs.push(`External: ${(0, import_filesize.filesize)(usage.external)}`);
|
|
52
42
|
}
|
|
53
43
|
return `["${import_process.pid}" Memory Usage] ${msgs.join(", ")}`;
|
|
54
44
|
}
|
|
@@ -6,6 +6,7 @@ const getMemoryInfo = () => helpers.getMemoryInfo().then((res) => res[1]);
|
|
|
6
6
|
const getNodeVersion = () => helpers.getNodeInfo().then((res) => res[1]);
|
|
7
7
|
const getYarnVersion = () => helpers.getYarnInfo().then((res) => res[1]);
|
|
8
8
|
const getNpmVersion = () => helpers.getnpmInfo().then((res) => res[1]);
|
|
9
|
+
const getPnpmVersion = () => helpers.getpnpmInfo().then((res) => res[1]);
|
|
9
10
|
function getNpmPackageVersion(pkg) {
|
|
10
11
|
const isArray = Array.isArray(pkg);
|
|
11
12
|
return run(
|
|
@@ -69,5 +70,6 @@ export {
|
|
|
69
70
|
getNpmPackageVersion,
|
|
70
71
|
getNpmVersion,
|
|
71
72
|
getOSInfo,
|
|
73
|
+
getPnpmVersion,
|
|
72
74
|
getYarnVersion
|
|
73
75
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { filesize } from "filesize";
|
|
2
2
|
import { memoryUsage, pid } from "process";
|
|
3
3
|
function getMemoryUsage() {
|
|
4
4
|
return memoryUsage();
|
|
@@ -6,15 +6,15 @@ function getMemoryUsage() {
|
|
|
6
6
|
function getMemoryUsageMessage() {
|
|
7
7
|
const usage = getMemoryUsage();
|
|
8
8
|
const msgs = [
|
|
9
|
-
`RSS: ${
|
|
10
|
-
`Heap Total: ${
|
|
11
|
-
`Heap Used: ${
|
|
9
|
+
`RSS: ${filesize(usage.rss)}`,
|
|
10
|
+
`Heap Total: ${filesize(usage.heapTotal)}`,
|
|
11
|
+
`Heap Used: ${filesize(usage.heapUsed)}`
|
|
12
12
|
];
|
|
13
13
|
if (usage.arrayBuffers) {
|
|
14
|
-
msgs.push(`ArrayBuffers: ${
|
|
14
|
+
msgs.push(`ArrayBuffers: ${filesize(usage.arrayBuffers)}`);
|
|
15
15
|
}
|
|
16
16
|
if (usage.external) {
|
|
17
|
-
msgs.push(`External: ${
|
|
17
|
+
msgs.push(`External: ${filesize(usage.external)}`);
|
|
18
18
|
}
|
|
19
19
|
return `["${pid}" Memory Usage] ${msgs.join(", ")}`;
|
|
20
20
|
}
|
|
@@ -4,6 +4,7 @@ export declare const getMemoryInfo: () => Promise<string>;
|
|
|
4
4
|
export declare const getNodeVersion: () => Promise<string>;
|
|
5
5
|
export declare const getYarnVersion: () => Promise<string>;
|
|
6
6
|
export declare const getNpmVersion: () => Promise<string>;
|
|
7
|
+
export declare const getPnpmVersion: () => Promise<string>;
|
|
7
8
|
export declare function getNpmPackageVersion(pkg: string): Promise<string>;
|
|
8
9
|
export declare function getNpmPackageVersion(pkgs: string[]): Promise<string[]>;
|
|
9
10
|
export declare function getGlobalNpmPackageVersion(pkg: string): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envinfo.d.ts","sourceRoot":"","sources":["../../../src/build/envinfo.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"envinfo.d.ts","sourceRoot":"","sources":["../../../src/build/envinfo.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,uBAAmD,CAAC;AAE3E,eAAO,MAAM,SAAS,uBAAkD,CAAC;AAEzE,eAAO,MAAM,aAAa,uBACqB,CAAC;AAEhD,eAAO,MAAM,cAAc,uBAAoD,CAAC;AAEhF,eAAO,MAAM,cAAc,uBAAoD,CAAC;AAEhF,eAAO,MAAM,aAAa,uBAAmD,CAAC;AAE9E,eAAO,MAAM,cAAc,uBAAoD,CAAC;AAEhF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AACnE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAgBxE,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AACzE,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAgB9E,wBAAgB,YAAY,oBAsB3B;AAED,wBAAgB,UAAU,oBAOzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/utils",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -72,11 +72,11 @@
|
|
|
72
72
|
"acorn": "^8.10.0",
|
|
73
73
|
"acorn-import-assertions": "1.9.0",
|
|
74
74
|
"acorn-walk": "8.3.2",
|
|
75
|
-
"bytes": "3.1.2",
|
|
76
75
|
"chalk": "^4.1.2",
|
|
77
76
|
"connect": "3.7.0",
|
|
78
77
|
"deep-eql": "4.1.0",
|
|
79
78
|
"envinfo": "7.13.0",
|
|
79
|
+
"filesize": "^10.1.2",
|
|
80
80
|
"fs-extra": "^11.1.1",
|
|
81
81
|
"get-port": "5.1.1",
|
|
82
82
|
"json-stream-stringify": "3.0.1",
|
|
@@ -84,14 +84,13 @@
|
|
|
84
84
|
"lodash": "^4.17.21",
|
|
85
85
|
"rslog": "^1.2.0",
|
|
86
86
|
"strip-ansi": "^6.0.1",
|
|
87
|
-
"@rsdoctor/types": "0.3.
|
|
87
|
+
"@rsdoctor/types": "0.3.3"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@types/deep-eql": "4.0.0",
|
|
91
90
|
"@types/babel__code-frame": "7.0.3",
|
|
92
|
-
"@types/bytes": "3.1.1",
|
|
93
91
|
"@types/connect": "3.4.35",
|
|
94
|
-
"@types/
|
|
92
|
+
"@types/deep-eql": "4.0.0",
|
|
93
|
+
"@types/envinfo": "7.8.4",
|
|
95
94
|
"@types/fs-extra": "^11.0.2",
|
|
96
95
|
"@types/lodash": "^4.17.0",
|
|
97
96
|
"@types/node": "^16",
|