copy-folder-util 1.1.3 → 1.1.5
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/LICENSE.txt +1 -1
- package/README.md +5 -5
- package/bin/cli.js +1 -1
- package/dist/copy-folder.d.ts +1 -1
- package/dist/copy-folder.js +3 -3
- package/package.json +16 -41
package/LICENSE.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2022-
|
|
3
|
+
Copyright (c) 2022-2025 Individual contributors to copy-folder-util
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# copy-folder-util
|
|
2
2
|
<img src=https://centerkey.com/graphics/center-key-logo.svg align=right width=200 alt=logo>
|
|
3
3
|
|
|
4
|
-
_Recursively copy files from one folder to another folder (CLI tool designed for use in npm scripts)_
|
|
4
|
+
_Recursively copy files from one folder to another folder (CLI tool designed for use in npm package.json scripts)_
|
|
5
5
|
|
|
6
6
|
[](https://github.com/center-key/copy-folder-util/blob/main/LICENSE.txt)
|
|
7
7
|
[](https://www.npmjs.com/package/copy-folder-util)
|
|
8
|
-
[](https://github.com/center-key/copy-folder-util/actions/workflows/run-spec-on-push.yaml)
|
|
9
9
|
|
|
10
10
|
**copy-folder-util** takes a source folder and copies its files and subfolders to a new destination.
|
|
11
11
|
The command's console output includes a timestamp and formatting helpful in build systems.
|
|
@@ -20,7 +20,7 @@ $ npm install --save-dev copy-folder-util
|
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## B) Usage
|
|
23
|
-
### 1. npm scripts
|
|
23
|
+
### 1. npm package.json scripts
|
|
24
24
|
Run `copy-folder` from the `"scripts"` section of your **package.json** file.
|
|
25
25
|
|
|
26
26
|
Parameters:
|
|
@@ -84,7 +84,7 @@ const results = copyFolder.cp('src/web', 'docs/api-manual', options);
|
|
|
84
84
|
console.log('Number of files copied:', results.count);
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
See the **TypeScript Declarations** at the top of [copy-folder.ts](copy-folder.ts) for documentation.
|
|
87
|
+
See the **TypeScript Declarations** at the top of [copy-folder.ts](src/copy-folder.ts) for documentation.
|
|
88
88
|
|
|
89
89
|
<br>
|
|
90
90
|
|
|
@@ -96,7 +96,7 @@ See the **TypeScript Declarations** at the top of [copy-folder.ts](copy-folder.t
|
|
|
96
96
|
- 🪺 [recursive-exec](https://github.com/center-key/recursive-exec): _Run a command on each file in a folder and its subfolders_
|
|
97
97
|
- 🔍 [replacer-util](https://github.com/center-key/replacer-util): _Find and replace strings or template outputs in text files_
|
|
98
98
|
- 🔢 [rev-web-assets](https://github.com/center-key/rev-web-assets): _Revision web asset filenames with cache busting content hash fingerprints_
|
|
99
|
-
- 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util): _Organize npm scripts into
|
|
99
|
+
- 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util): _Organize npm package.json scripts into groups of easy to manage commands_
|
|
100
100
|
- 🚦 [w3c-html-validator](https://github.com/center-key/w3c-html-validator): _Check the markup validity of HTML files using the W3C validator_
|
|
101
101
|
|
|
102
102
|
Feel free to submit questions at:<br>
|
package/bin/cli.js
CHANGED
|
@@ -38,7 +38,7 @@ const error =
|
|
|
38
38
|
cli.paramsCount > 2 ? 'Extraneous parameter: ' + cli.params[2] :
|
|
39
39
|
null;
|
|
40
40
|
if (error)
|
|
41
|
-
throw Error('[copy-folder-util] ' + error);
|
|
41
|
+
throw new Error('[copy-folder-util] ' + error);
|
|
42
42
|
const options = {
|
|
43
43
|
cd: cli.flagMap.cd ?? null,
|
|
44
44
|
fileExtensions: cli.flagMap.ext?.split(',') ?? [],
|
package/dist/copy-folder.d.ts
CHANGED
package/dist/copy-folder.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//! copy-folder-util v1.1.
|
|
1
|
+
//! copy-folder-util v1.1.5 ~~ https://github.com/center-key/copy-folder-util ~~ MIT License
|
|
2
2
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import fs from 'fs';
|
|
@@ -30,10 +30,10 @@ const copyFolder = {
|
|
|
30
30
|
!fs.statSync(target).isDirectory() ? 'Target is not a folder: ' + target :
|
|
31
31
|
null;
|
|
32
32
|
if (errorMessage)
|
|
33
|
-
throw Error('[copy-folder-util] ' + errorMessage);
|
|
33
|
+
throw new Error('[copy-folder-util] ' + errorMessage);
|
|
34
34
|
const filterOff = {
|
|
35
35
|
base: !settings.basename,
|
|
36
|
-
ext: !settings.fileExtensions || settings.fileExtensions.length
|
|
36
|
+
ext: !Array.isArray(settings.fileExtensions) || !settings.fileExtensions.length,
|
|
37
37
|
};
|
|
38
38
|
const files = [];
|
|
39
39
|
const posixPath = (nativePath) => slash(nativePath.replace(/.*:/, ''));
|
package/package.json
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "copy-folder-util",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Recursively copy files from one folder to another folder (CLI tool designed for use in npm scripts)",
|
|
3
|
+
"version": "1.1.5",
|
|
4
|
+
"description": "Recursively copy files from one folder to another folder (CLI tool designed for use in npm package.json scripts)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"module": "dist/copy-folder.js",
|
|
8
|
-
"main": "dist/copy-folder.js",
|
|
9
8
|
"types": "dist/copy-folder.d.ts",
|
|
9
|
+
"exports": "./dist/copy-folder.js",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"import": "./dist/copy-folder.js"
|
|
16
|
-
},
|
|
17
|
-
"./": "./dist/"
|
|
18
|
-
},
|
|
19
13
|
"bin": {
|
|
20
14
|
"copy-folder": "bin/cli.js",
|
|
21
15
|
"copy-folder-util": "bin/cli.js"
|
|
@@ -49,32 +43,13 @@
|
|
|
49
43
|
"node": true,
|
|
50
44
|
"mocha": true
|
|
51
45
|
},
|
|
52
|
-
"eslintConfig": {
|
|
53
|
-
"ignorePatterns": [
|
|
54
|
-
"build",
|
|
55
|
-
"dist",
|
|
56
|
-
"node_modules"
|
|
57
|
-
],
|
|
58
|
-
"root": true,
|
|
59
|
-
"parser": "@typescript-eslint/parser",
|
|
60
|
-
"plugins": [
|
|
61
|
-
"@typescript-eslint"
|
|
62
|
-
],
|
|
63
|
-
"extends": [
|
|
64
|
-
"eslint:recommended",
|
|
65
|
-
"plugin:@typescript-eslint/recommended"
|
|
66
|
-
],
|
|
67
|
-
"rules": {
|
|
68
|
-
"@typescript-eslint/no-non-null-assertion": "off"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
46
|
"runScriptsConfig": {
|
|
72
47
|
"clean": [
|
|
73
48
|
"rimraf build dist spec/fixtures/target"
|
|
74
49
|
],
|
|
75
50
|
"lint": [
|
|
76
51
|
"jshint . --exclude-path .gitignore",
|
|
77
|
-
"eslint --max-warnings 0
|
|
52
|
+
"eslint --max-warnings 0"
|
|
78
53
|
],
|
|
79
54
|
"build": [
|
|
80
55
|
"tsc",
|
|
@@ -86,24 +61,24 @@
|
|
|
86
61
|
"test": "mocha spec/*.spec.js"
|
|
87
62
|
},
|
|
88
63
|
"dependencies": {
|
|
89
|
-
"chalk": "~5.
|
|
64
|
+
"chalk": "~5.4",
|
|
90
65
|
"cli-argv-util": "~1.2",
|
|
91
66
|
"fancy-log": "~2.0",
|
|
92
67
|
"slash": "~5.1"
|
|
93
68
|
},
|
|
94
69
|
"devDependencies": {
|
|
70
|
+
"@eslint/js": "~9.21",
|
|
95
71
|
"@types/fancy-log": "~2.0",
|
|
96
|
-
"@types/node": "~
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"copy-file-util": "~1.1",
|
|
102
|
-
"eslint": "~8.56",
|
|
72
|
+
"@types/node": "~22.13",
|
|
73
|
+
"add-dist-header": "~1.4",
|
|
74
|
+
"assert-deep-strict-equal": "~1.2",
|
|
75
|
+
"copy-file-util": "~1.2",
|
|
76
|
+
"eslint": "~9.21",
|
|
103
77
|
"jshint": "~2.13",
|
|
104
|
-
"mocha": "~
|
|
105
|
-
"rimraf": "~
|
|
106
|
-
"run-scripts-util": "~1.
|
|
107
|
-
"typescript": "~5.
|
|
78
|
+
"mocha": "~11.1",
|
|
79
|
+
"rimraf": "~6.0",
|
|
80
|
+
"run-scripts-util": "~1.3",
|
|
81
|
+
"typescript": "~5.8",
|
|
82
|
+
"typescript-eslint": "~8.26"
|
|
108
83
|
}
|
|
109
84
|
}
|