@naturalcycles/nodejs-lib 13.43.0 → 13.43.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.
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runScript = runScript;
4
4
  const tslib_1 = require("tslib");
5
5
  const node_os_1 = tslib_1.__importDefault(require("node:os"));
6
- const node_util_1 = require("node:util");
7
6
  const js_lib_1 = require("@naturalcycles/js-lib");
7
+ const colors_1 = require("../colors/colors");
8
8
  const inspect_1 = require("../string/inspect");
9
9
  const { DEBUG_RUN_SCRIPT } = process.env;
10
10
  /**
@@ -66,13 +66,13 @@ function runScript(fn, opt = {}) {
66
66
  })();
67
67
  }
68
68
  function logEnvironment() {
69
- const { platform, arch, versions: { node }, env: { CPU_LIMIT, NODE_OPTIONS = 'not defined' }, } = process;
69
+ const { platform, arch, versions: { node }, env: { CPU_LIMIT, NODE_OPTIONS }, } = process;
70
70
  const cpuLimit = Number(CPU_LIMIT) || undefined;
71
71
  const availableParallelism = node_os_1.default.availableParallelism?.();
72
72
  const cpus = node_os_1.default.cpus().length;
73
- console.log(dimGrey(Object.entries({
73
+ console.log((0, colors_1.dimGrey)(Object.entries({
74
74
  node: `${node} ${platform} ${arch}`,
75
- NODE_OPTIONS,
75
+ NODE_OPTIONS: NODE_OPTIONS || 'not defined',
76
76
  cpus,
77
77
  availableParallelism,
78
78
  cpuLimit,
@@ -86,6 +86,3 @@ function logEnvironment() {
86
86
  console.warn(`It looks like you're using "max_old_space_size" syntax with underscores instead of dashes - it's WRONG and doesn't work in environment variables. Strongly advised to rename it to "max-old-space-size"`);
87
87
  }
88
88
  }
89
- function dimGrey(s) {
90
- return (0, node_util_1.styleText)(['dim', 'grey'], s);
91
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
- "version": "13.43.0",
3
+ "version": "13.43.1",
4
4
  "scripts": {
5
5
  "prepare": "husky",
6
6
  "build": "dev-lib build",
@@ -1,7 +1,7 @@
1
1
  import os from 'node:os'
2
- import { styleText } from 'node:util'
3
2
  import type { CommonLogger } from '@naturalcycles/js-lib'
4
3
  import { pDelay, setGlobalStringifyFunction } from '@naturalcycles/js-lib'
4
+ import { dimGrey } from '../colors/colors'
5
5
  import { inspectStringifyFn } from '../string/inspect'
6
6
 
7
7
  export interface RunScriptOptions {
@@ -95,7 +95,7 @@ function logEnvironment(): void {
95
95
  platform,
96
96
  arch,
97
97
  versions: { node },
98
- env: { CPU_LIMIT, NODE_OPTIONS = 'not defined' },
98
+ env: { CPU_LIMIT, NODE_OPTIONS },
99
99
  } = process
100
100
 
101
101
  const cpuLimit = Number(CPU_LIMIT) || undefined
@@ -105,7 +105,7 @@ function logEnvironment(): void {
105
105
  dimGrey(
106
106
  Object.entries({
107
107
  node: `${node} ${platform} ${arch}`,
108
- NODE_OPTIONS,
108
+ NODE_OPTIONS: NODE_OPTIONS || 'not defined',
109
109
  cpus,
110
110
  availableParallelism,
111
111
  cpuLimit,
@@ -125,7 +125,3 @@ function logEnvironment(): void {
125
125
  )
126
126
  }
127
127
  }
128
-
129
- function dimGrey(s: string): string {
130
- return styleText(['dim', 'grey'], s)
131
- }