@putout/formatter-memory 1.4.0 → 3.0.0
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 +4 -8
- package/lib/memory.js +11 -14
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
# @putout/
|
|
1
|
+
# @putout/formatter-memory [![NPM version][NPMIMGURL]][NPMURL]
|
|
2
2
|
|
|
3
|
-
[NPMIMGURL]:
|
|
4
|
-
[NPMURL]:
|
|
3
|
+
[NPMIMGURL]: https://img.shields.io/npm/v/@putout/formatter-memory.svg?style=flat&longCache=true
|
|
4
|
+
[NPMURL]: https://npmjs.org/package/@putout/formatter-memory "npm"
|
|
5
5
|
|
|
6
|
-
[
|
|
7
|
-
[DependencyStatusIMGURL]: https://david-dm.org/coderaiser/putout.svg?path=packages/formatter-memory
|
|
8
|
-
|
|
9
|
-
`putout` formatter shows memory used.
|
|
6
|
+
🐊[**Putout**](https://github.com/coderaiser/putout) formatter shows memory used.
|
|
10
7
|
|
|
11
8
|
## Install
|
|
12
9
|
|
|
@@ -42,4 +39,3 @@ Formatters takes options, that can be set in `.putout.json` with:
|
|
|
42
39
|
## License
|
|
43
40
|
|
|
44
41
|
MIT
|
|
45
|
-
|
package/lib/memory.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import {Writable} from 'stream';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const format = require('format-io');
|
|
10
|
-
const montag = require('montag');
|
|
3
|
+
import dump from '@putout/formatter-dump';
|
|
4
|
+
import cliProgress from 'cli-progress';
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
import once from 'once';
|
|
7
|
+
import format from 'format-io';
|
|
8
|
+
import montag from 'montag';
|
|
11
9
|
|
|
12
10
|
const OK = '👌';
|
|
13
11
|
const {
|
|
@@ -23,7 +21,7 @@ const {
|
|
|
23
21
|
TEST = 0,
|
|
24
22
|
} = process.env;
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
export default ({name, options, places, index, count, filesCount, errorsCount}) => {
|
|
27
25
|
const {
|
|
28
26
|
color = '#ea4336',
|
|
29
27
|
minCount = 0,
|
|
@@ -78,8 +76,7 @@ const getColorFn = (color) => {
|
|
|
78
76
|
return chalk[color];
|
|
79
77
|
};
|
|
80
78
|
|
|
81
|
-
const
|
|
82
|
-
module.exports._getStream = getStream;
|
|
79
|
+
export const _getStream = () => PUTOUT_PROGRESS_BAR !== '1' ? new Writable() : stderr;
|
|
83
80
|
|
|
84
81
|
const createProgress = once(({count, color, rss}) => {
|
|
85
82
|
const colorFn = getColorFn(color);
|
|
@@ -89,7 +86,7 @@ const createProgress = once(({count, color, rss}) => {
|
|
|
89
86
|
barIncompleteChar: '\u2591',
|
|
90
87
|
clearOnComplete: true,
|
|
91
88
|
stopOnComplete: true,
|
|
92
|
-
stream:
|
|
89
|
+
stream: _getStream(),
|
|
93
90
|
hideCursor: true,
|
|
94
91
|
}, cliProgress.Presets.react);
|
|
95
92
|
|
|
@@ -112,7 +109,7 @@ const parseMemory = (memory) => {
|
|
|
112
109
|
return memory;
|
|
113
110
|
};
|
|
114
111
|
|
|
115
|
-
|
|
112
|
+
export const _parseMemory = parseMemory;
|
|
116
113
|
|
|
117
114
|
function getInfo(memory) {
|
|
118
115
|
const {
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/formatter-memory",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
5
|
-
"description": "putout formatter shows
|
|
6
|
-
"homepage": "
|
|
5
|
+
"description": "putout formatter shows memory usage",
|
|
6
|
+
"homepage": "https://github.com/coderaiser/putout/tree/master/packages/formatter-memory#readme",
|
|
7
7
|
"main": "lib/memory.js",
|
|
8
8
|
"release": false,
|
|
9
9
|
"tag": false,
|
|
10
10
|
"changelog": false,
|
|
11
|
+
"type": "module",
|
|
11
12
|
"repository": {
|
|
12
13
|
"type": "git",
|
|
13
14
|
"url": "git://github.com/coderaiser/putout.git"
|
|
@@ -25,8 +26,8 @@
|
|
|
25
26
|
"report": "madrun report"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@putout/formatter-dump": "^
|
|
29
|
-
"chalk": "^
|
|
29
|
+
"@putout/formatter-dump": "^4.0.0",
|
|
30
|
+
"chalk": "^5.0.1",
|
|
30
31
|
"cli-progress": "^3.8.2",
|
|
31
32
|
"format-io": "^2.0.0",
|
|
32
33
|
"montag": "^1.1.0",
|
|
@@ -40,21 +41,20 @@
|
|
|
40
41
|
],
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@putout/plugin-remove-unused-variables": "*",
|
|
43
|
-
"@putout/test": "^
|
|
44
|
-
"
|
|
45
|
-
"eslint": "^
|
|
44
|
+
"@putout/test": "^5.0.0",
|
|
45
|
+
"c8": "^7.5.0",
|
|
46
|
+
"eslint": "^8.0.1",
|
|
46
47
|
"eslint-plugin-node": "^11.0.0",
|
|
47
|
-
"eslint-plugin-putout": "^
|
|
48
|
-
"madrun": "^
|
|
49
|
-
"mock-require": "^3.0.3"
|
|
50
|
-
"nyc": "^15.0.1"
|
|
48
|
+
"eslint-plugin-putout": "^14.0.0",
|
|
49
|
+
"madrun": "^9.0.0",
|
|
50
|
+
"mock-require": "^3.0.3"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"putout": ">=
|
|
53
|
+
"putout": ">=25"
|
|
54
54
|
},
|
|
55
55
|
"license": "MIT",
|
|
56
56
|
"engines": {
|
|
57
|
-
"node": ">=
|
|
57
|
+
"node": ">=16"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|