copymitter 6.0.3 → 7.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/ChangeLog +23 -0
- package/README.md +4 -6
- package/lib/copymitter.js +6 -1
- package/package.json +11 -10
package/ChangeLog
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
2022.10.09, v7.0.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- copymitter: end: add support of errors (https://github.com/coderaiser/cloudcmd/is
|
|
5
|
+
- copymitter: drop support of node < 16
|
|
6
|
+
- (package) eslint-plugin-putout v16.3.0
|
|
7
|
+
- (package) madrun v9.0.6
|
|
8
|
+
- (package) supertape v8.1.0
|
|
9
|
+
- (package) putout v27.13.0
|
|
10
|
+
- (package) eslint v8.25.0
|
|
11
|
+
- (package) @iocmd/wait v2.1.0
|
|
12
|
+
- (package) supertape v5.4.1
|
|
13
|
+
- (package) putout v18.0.1
|
|
14
|
+
- (package) eslint-plugin-putout v8.0.1
|
|
15
|
+
|
|
16
|
+
2021.02.27, v6.0.4
|
|
17
|
+
|
|
18
|
+
feature:
|
|
19
|
+
- (package) supertape v5.0.0
|
|
20
|
+
- (package) putout v15.3.1
|
|
21
|
+
- (package) redzip v2.0.0
|
|
22
|
+
|
|
23
|
+
|
|
1
24
|
2021.02.18, v6.0.3
|
|
2
25
|
|
|
3
26
|
fix:
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copymitter [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![
|
|
1
|
+
# Copymitter [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
|
|
2
2
|
|
|
3
3
|
Copy files with emitter (even from and to `zip archives`). It will emit event on every percent of copied chunk of data.
|
|
4
4
|
Good for making progress bars.
|
|
@@ -55,7 +55,7 @@ cp.on('error', (error) => {
|
|
|
55
55
|
cp.continue();
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
cp.on('end', () => {
|
|
58
|
+
cp.on('end', ({errors}) => {
|
|
59
59
|
console.log('Copying ended up');
|
|
60
60
|
});
|
|
61
61
|
|
|
@@ -74,12 +74,10 @@ cp.pause();
|
|
|
74
74
|
MIT
|
|
75
75
|
|
|
76
76
|
[NPMIMGURL]: https://img.shields.io/npm/v/copymitter.svg?style=flat
|
|
77
|
-
[
|
|
78
|
-
[
|
|
77
|
+
[BuildStatusURL]: https://github.com/coderaiser/copymitter/actions?query=workflow%3A%22Node+CI%22 "Build Status"
|
|
78
|
+
[BuildStatusIMGURL]: https://github.com/coderaiser/copymitter/workflows/Node%20CI/badge.svg
|
|
79
79
|
[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
|
|
80
80
|
[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/node-copymitter/badge.svg?branch=master&service=github
|
|
81
81
|
[NPMURL]: https://npmjs.org/package/copymitter "npm"
|
|
82
|
-
[BuildStatusURL]: https://travis-ci.org/coderaiser/node-copymitter "Build Status"
|
|
83
|
-
[DependencyStatusURL]: https://david-dm.org/coderaiser/node-copymitter "Dependency Status"
|
|
84
82
|
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
|
|
85
83
|
[CoverageURL]: https://coveralls.io/github/coderaiser/node-copymitter?branch=master
|
package/lib/copymitter.js
CHANGED
|
@@ -38,6 +38,7 @@ function Copymitter(from, to, files) {
|
|
|
38
38
|
EventEmitter.call(this);
|
|
39
39
|
|
|
40
40
|
this._files = [];
|
|
41
|
+
this._errors = [];
|
|
41
42
|
this._size = 0;
|
|
42
43
|
this._i = 0;
|
|
43
44
|
this._n = 0;
|
|
@@ -95,7 +96,9 @@ Copymitter.prototype._cpAll = function() {
|
|
|
95
96
|
const name = this._files.pop();
|
|
96
97
|
|
|
97
98
|
if (!name)
|
|
98
|
-
return this.emit('end'
|
|
99
|
+
return this.emit('end', {
|
|
100
|
+
errors: this._errors,
|
|
101
|
+
});
|
|
99
102
|
|
|
100
103
|
const fromFull = path.join(from, name);
|
|
101
104
|
const toFull = path.join(to, name);
|
|
@@ -104,6 +107,8 @@ Copymitter.prototype._cpAll = function() {
|
|
|
104
107
|
cpEmitter.on('error', (error) => {
|
|
105
108
|
log('cpEmitter error: ' + error);
|
|
106
109
|
this.emit('error', error);
|
|
110
|
+
|
|
111
|
+
this._errors.push(error);
|
|
107
112
|
this._i += 0.01;
|
|
108
113
|
});
|
|
109
114
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "copymitter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"commitType": "colon",
|
|
4
6
|
"description": "copy files with emitter",
|
|
5
7
|
"main": "lib/copymitter.js",
|
|
6
8
|
"scripts": {
|
|
@@ -20,26 +22,25 @@
|
|
|
20
22
|
"findit2": "^2.2.3",
|
|
21
23
|
"fullstore": "^3.0.0",
|
|
22
24
|
"mkdirp": "^1.0.3",
|
|
23
|
-
"redzip": "^
|
|
25
|
+
"redzip": "^2.0.0",
|
|
24
26
|
"squad": "^3.0.0",
|
|
25
27
|
"through2": "^4.0.2",
|
|
26
28
|
"try-to-catch": "^3.0.0",
|
|
27
29
|
"zames": "^3.0.0"
|
|
28
30
|
},
|
|
29
31
|
"devDependencies": {
|
|
30
|
-
"@iocmd/wait": "^1.0
|
|
32
|
+
"@iocmd/wait": "^2.1.0",
|
|
31
33
|
"c8": "^7.5.0",
|
|
32
|
-
"
|
|
33
|
-
"eslint": "^7.6.0",
|
|
34
|
+
"eslint": "^8.25.0",
|
|
34
35
|
"eslint-plugin-node": "^11.0.0",
|
|
35
|
-
"eslint-plugin-putout": "^
|
|
36
|
-
"madrun": "^
|
|
36
|
+
"eslint-plugin-putout": "^16.3.0",
|
|
37
|
+
"madrun": "^9.0.6",
|
|
37
38
|
"mock-require": "^3.0.3",
|
|
38
39
|
"nodemon": "^2.0.2",
|
|
39
40
|
"pullout": "^4.0.0",
|
|
40
|
-
"putout": "^
|
|
41
|
+
"putout": "^27.13.0",
|
|
41
42
|
"rimraf": "^3.0.0",
|
|
42
|
-
"supertape": "^
|
|
43
|
+
"supertape": "^8.1.0",
|
|
43
44
|
"try-catch": "^3.0.0"
|
|
44
45
|
},
|
|
45
46
|
"repository": {
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"file"
|
|
55
56
|
],
|
|
56
57
|
"engines": {
|
|
57
|
-
"node": ">=
|
|
58
|
+
"node": ">=16"
|
|
58
59
|
},
|
|
59
60
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (http://coderaiser.github.io/)",
|
|
60
61
|
"license": "MIT",
|