copymitter 8.0.1 → 9.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 CHANGED
@@ -1,3 +1,27 @@
1
+ 2024.05.06, v9.0.0
2
+
3
+ feature:
4
+ - c2a6aad package: drop support of node < 18
5
+ - a437d76 copymitter: redlint v3.14.1
6
+ - 52a9479 copymitter: eslint v9.2.0
7
+ - 96f7c54 copymitter: eslint-plugin-putout v22.6.1
8
+ - a3712c8 copymitter: madrun v10.0.1
9
+ - b809b30 copymitter: supertape v10.5.0
10
+ - 35f664b copymitter: putout v35.20.0
11
+ - 92930be copymitter: nodemon v3.1.0
12
+ - 3d9f16a copymitter: mkdirp v3.0.1
13
+ - 0b37a74 copymitter: c8 v9.1.0
14
+ - d4455bc copymitter: pullout v5.0.1
15
+
16
+ 2023.08.09, v8.1.0
17
+
18
+ feature:
19
+ - 20671e7 package: rimraf v5.0.1
20
+ - 643c877 package: c8 v8.0.1
21
+ - c2a65a3 package: eslint-plugin-putout v19.0.3
22
+ - e038810 package: putout v31.0.4
23
+ - fa90ae3 package: redzip v3.0.0
24
+
1
25
  2023.03.21, v8.0.1
2
26
 
3
27
  fix:
package/README.md CHANGED
@@ -18,11 +18,7 @@ const from = `${cwd}/pipe-io`;
18
18
  const to = `${cwd}/example`;
19
19
  const abortOnError = false;
20
20
 
21
- const cp = copymitter(from, to, [
22
- 'LICENSE',
23
- 'README.md',
24
- 'package.json',
25
- ]);
21
+ const cp = copymitter(from, to, ['LICENSE', 'README.md', 'package.json']);
26
22
 
27
23
  cp.on('file', (from, to) => {
28
24
  console.log(`${from} -> ${to}`);
package/lib/copymitter.js CHANGED
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
 
3
- const path = require('path');
4
- const {readlink} = require('fs/promises');
5
- const {inherits} = require('util');
6
- const {EventEmitter} = require('events');
3
+ const process = require('node:process');
4
+ const path = require('node:path');
5
+ const {readlink} = require('node:fs/promises');
6
+ const {inherits} = require('node:util');
7
+ const {EventEmitter} = require('node:events');
7
8
 
8
9
  const log = require('debug')('copymitter');
9
10
  const through2 = require('through2');
@@ -20,6 +21,8 @@ const {
20
21
  list,
21
22
  } = require('redzip');
22
23
 
24
+ const isString = (a) => typeof a === 'string';
25
+
23
26
  inherits(Copymitter, EventEmitter);
24
27
 
25
28
  module.exports = (from, to, files) => {
@@ -124,6 +127,7 @@ Copymitter.prototype._cpAll = function() {
124
127
 
125
128
  const copyDir = async (from, to) => {
126
129
  const {mode} = await readStat(from);
130
+
127
131
  await write(to, null, {
128
132
  mode,
129
133
  });
@@ -241,13 +245,12 @@ Copymitter.prototype._progress = function() {
241
245
  };
242
246
 
243
247
  function check(from, to, files) {
244
- if (typeof from !== 'string')
248
+ if (!isString(from))
245
249
  throw Error('from should be a string!');
246
250
 
247
- if (typeof to !== 'string')
251
+ if (!isString(to))
248
252
  throw Error('to should be a string!');
249
253
 
250
254
  if (!Array.isArray(files))
251
255
  throw Error('files should be an array!');
252
256
  }
253
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copymitter",
3
- "version": "8.0.1",
3
+ "version": "9.0.0",
4
4
  "type": "commonjs",
5
5
  "description": "copy files with emitter",
6
6
  "main": "lib/copymitter.js",
@@ -20,8 +20,8 @@
20
20
  "debug": "^4.0.1",
21
21
  "findit2": "^2.2.3",
22
22
  "fullstore": "^3.0.0",
23
- "mkdirp": "^2.1.5",
24
- "redzip": "^2.0.0",
23
+ "mkdirp": "^3.0.1",
24
+ "redzip": "^3.0.0",
25
25
  "squad": "^3.0.0",
26
26
  "through2": "^4.0.2",
27
27
  "try-to-catch": "^3.0.0",
@@ -29,17 +29,18 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@iocmd/wait": "^2.1.0",
32
- "c8": "^7.5.0",
33
- "eslint": "^8.25.0",
32
+ "c8": "^9.1.0",
33
+ "eslint": "^9.2.0",
34
34
  "eslint-plugin-node": "^11.0.0",
35
- "eslint-plugin-putout": "^17.1.0",
36
- "madrun": "^9.0.6",
35
+ "eslint-plugin-putout": "^22.6.1",
36
+ "madrun": "^10.0.1",
37
37
  "mock-require": "^3.0.3",
38
- "nodemon": "^2.0.2",
39
- "pullout": "^4.0.0",
40
- "putout": "^29.1.5",
41
- "rimraf": "^4.4.0",
42
- "supertape": "^8.1.0",
38
+ "nodemon": "^3.1.0",
39
+ "pullout": "^5.0.1",
40
+ "putout": "^35.20.0",
41
+ "redlint": "^3.14.1",
42
+ "rimraf": "^5.0.1",
43
+ "supertape": "^10.5.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": ">=16"
58
+ "node": ">=18"
58
59
  },
59
60
  "author": "coderaiser <mnemonic.enemy@gmail.com> (http://coderaiser.github.io/)",
60
61
  "license": "MIT",