copymitter 7.0.0 → 8.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 +9 -0
- package/README.md +6 -2
- package/lib/copymitter.js +2 -2
- package/package.json +5 -6
package/ChangeLog
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
2023.03.21, v8.0.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 339dce0 package: eslint-plugin-putout v17.1.0
|
|
5
|
+
- 9dee669 package: mkdirp v2.1.5
|
|
6
|
+
- 033b35c package: putout v29.1.5
|
|
7
|
+
- 20814e4 package: rimraf v4.4.0
|
|
8
|
+
- 6c97038 copymitter: add support of "abort" event
|
|
9
|
+
|
|
1
10
|
2022.10.09, v7.0.0
|
|
2
11
|
|
|
3
12
|
feature:
|
package/README.md
CHANGED
|
@@ -14,8 +14,8 @@ npm i copymitter
|
|
|
14
14
|
```js
|
|
15
15
|
const copymitter = require('copymitter');
|
|
16
16
|
const cwd = process.cwd();
|
|
17
|
-
const from = cwd
|
|
18
|
-
const to = cwd
|
|
17
|
+
const from = `${cwd}/pipe-io`;
|
|
18
|
+
const to = `${cwd}/example`;
|
|
19
19
|
const abortOnError = false;
|
|
20
20
|
|
|
21
21
|
const cp = copymitter(from, to, [
|
|
@@ -55,6 +55,10 @@ cp.on('error', (error) => {
|
|
|
55
55
|
cp.continue();
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
+
cp.on('abort', () => {
|
|
59
|
+
console.log('Copying aborted');
|
|
60
|
+
});
|
|
61
|
+
|
|
58
62
|
cp.on('end', ({errors}) => {
|
|
59
63
|
console.log('Copying ended up');
|
|
60
64
|
});
|
package/lib/copymitter.js
CHANGED
|
@@ -87,7 +87,7 @@ Copymitter.prototype.pause = function() {
|
|
|
87
87
|
|
|
88
88
|
Copymitter.prototype.abort = function() {
|
|
89
89
|
this._files = [];
|
|
90
|
-
this.
|
|
90
|
+
this.emit('abort');
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
Copymitter.prototype._cpAll = function() {
|
|
@@ -105,7 +105,7 @@ Copymitter.prototype._cpAll = function() {
|
|
|
105
105
|
const cpEmitter = this.cpOneFile(fromFull, toFull);
|
|
106
106
|
|
|
107
107
|
cpEmitter.on('error', (error) => {
|
|
108
|
-
log(
|
|
108
|
+
log(`cpEmitter error: ${error}`);
|
|
109
109
|
this.emit('error', error);
|
|
110
110
|
|
|
111
111
|
this._errors.push(error);
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "copymitter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
|
-
"commitType": "colon",
|
|
6
5
|
"description": "copy files with emitter",
|
|
7
6
|
"main": "lib/copymitter.js",
|
|
8
7
|
"scripts": {
|
|
@@ -21,7 +20,7 @@
|
|
|
21
20
|
"debug": "^4.0.1",
|
|
22
21
|
"findit2": "^2.2.3",
|
|
23
22
|
"fullstore": "^3.0.0",
|
|
24
|
-
"mkdirp": "^1.
|
|
23
|
+
"mkdirp": "^2.1.5",
|
|
25
24
|
"redzip": "^2.0.0",
|
|
26
25
|
"squad": "^3.0.0",
|
|
27
26
|
"through2": "^4.0.2",
|
|
@@ -33,13 +32,13 @@
|
|
|
33
32
|
"c8": "^7.5.0",
|
|
34
33
|
"eslint": "^8.25.0",
|
|
35
34
|
"eslint-plugin-node": "^11.0.0",
|
|
36
|
-
"eslint-plugin-putout": "^
|
|
35
|
+
"eslint-plugin-putout": "^17.1.0",
|
|
37
36
|
"madrun": "^9.0.6",
|
|
38
37
|
"mock-require": "^3.0.3",
|
|
39
38
|
"nodemon": "^2.0.2",
|
|
40
39
|
"pullout": "^4.0.0",
|
|
41
|
-
"putout": "^
|
|
42
|
-
"rimraf": "^
|
|
40
|
+
"putout": "^29.1.5",
|
|
41
|
+
"rimraf": "^4.4.0",
|
|
43
42
|
"supertape": "^8.1.0",
|
|
44
43
|
"try-catch": "^3.0.0"
|
|
45
44
|
},
|