@bhsd/nodejs 0.1.0 → 0.1.1

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/dist/index.js +5 -3
  2. package/package.json +13 -13
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.refreshStdout = exports.profile = void 0;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
- const promises_1 = require("inspector/promises"); // eslint-disable-line n/no-unsupported-features/node-builtins
9
+ const promises_1 = require("inspector/promises");
10
10
  /**
11
11
  * Adds the ticks to the myTicks object.
12
12
  * @param myTicks ticks记录对象
@@ -25,7 +25,7 @@ const profile = async (callback, dir) => {
25
25
  await session.post('Profiler.enable');
26
26
  await session.post('Profiler.start');
27
27
  await callback();
28
- const { profile: { nodes } } = await session.post('Profiler.stop');
28
+ const { nodes } = (await session.post('Profiler.stop')).profile;
29
29
  const useful = nodes.filter(({ callFrame: { url }, hitCount, children }) => url.startsWith('file:///')
30
30
  && (hitCount || children)), summary = [];
31
31
  for (const { callFrame, hitCount, positionTicks } of useful) {
@@ -52,6 +52,8 @@ exports.profile = profile;
52
52
  * @param str 要输出的字符串
53
53
  */
54
54
  const refreshStdout = (str) => {
55
- process.stdout.write(`\x1B[K\x1B[?7l${str}\x1B[?7h\r`);
55
+ process.stdout.moveCursor(-process.stdout.columns, 0);
56
+ process.stdout.clearLine(0);
57
+ process.stdout.write(`\x1B[?7l${str}\x1B[?7h\r`);
56
58
  };
57
59
  exports.refreshStdout = refreshStdout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bhsd/nodejs",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "homepage": "https://github.com/bhsd-harry/nodejs#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/bhsd-harry/nodejs/issues"
@@ -19,22 +19,22 @@
19
19
  "lint": "npm run lint:ts"
20
20
  },
21
21
  "devDependencies": {
22
- "@bhsd/code-standard": "^1.3.1",
23
- "@stylistic/eslint-plugin": "^5.5.0",
24
- "@types/node": "^24.9.2",
25
- "@typescript-eslint/eslint-plugin": "^8.46.2",
26
- "@typescript-eslint/parser": "^8.46.2",
27
- "eslint": "^9.38.0",
22
+ "@bhsd/code-standard": "^2.1.0",
23
+ "@stylistic/eslint-plugin": "^5.9.0",
24
+ "@types/node": "^24.11.0",
25
+ "@typescript-eslint/eslint-plugin": "^8.54.0",
26
+ "@typescript-eslint/parser": "^8.54.0",
27
+ "eslint": "^9.39.3",
28
28
  "eslint-plugin-eslint-comments": "^3.2.0",
29
- "eslint-plugin-jsdoc": "^61.1.11",
30
- "eslint-plugin-jsonc": "^2.21.0",
31
- "eslint-plugin-n": "^17.23.1",
29
+ "eslint-plugin-jsdoc": "^62.7.1",
30
+ "eslint-plugin-jsonc": "^3.1.1",
31
+ "eslint-plugin-n": "^17.24.0",
32
32
  "eslint-plugin-promise": "^7.2.1",
33
- "eslint-plugin-regexp": "^2.10.0",
34
- "eslint-plugin-unicorn": "^62.0.0",
33
+ "eslint-plugin-regexp": "^3.0.0",
34
+ "eslint-plugin-unicorn": "^63.0.0",
35
35
  "typescript": "^5.9.3"
36
36
  },
37
37
  "engines": {
38
- "node": ">=18.17.0"
38
+ "node": ">=20.19.0"
39
39
  }
40
40
  }