copy-folder-util 1.1.0 → 1.1.1

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 CHANGED
@@ -5,7 +5,6 @@ _Recursively copy files from one folder to another folder (CLI tool designed for
5
5
 
6
6
  [![License:MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/center-key/copy-folder-util/blob/main/LICENSE.txt)
7
7
  [![npm](https://img.shields.io/npm/v/copy-folder-util.svg)](https://www.npmjs.com/package/copy-folder-util)
8
- [![Vulnerabilities](https://snyk.io/test/github/center-key/copy-folder-util/badge.svg)](https://snyk.io/test/github/center-key/copy-folder-util)
9
8
  [![Build](https://github.com/center-key/copy-folder-util/workflows/build/badge.svg)](https://github.com/center-key/copy-folder-util/actions/workflows/run-spec-on-push.yaml)
10
9
 
11
10
  **copy-folder-util** takes a source folder and copies its files and subfolders to a new destination. 
@@ -36,14 +35,13 @@ Example **package.json** scripts:
36
35
  },
37
36
  ```
38
37
 
39
- ### 2. Global
40
- You can install **copy-folder-util** globally and then run it anywhere directly from the terminal.
41
-
38
+ ### 2. Command-line npx
42
39
  Example terminal commands:
43
40
  ```shell
44
- $ npm install --global copy-folder-util
45
- $ copy-folder src/web ext=.html docs/api-manual
41
+ $ npm install --save-dev copy-folder-util
42
+ $ npx copy-folder src/web ext=.html docs/api-manual
46
43
  ```
44
+ You can also install **copy-folder-util** globally (`--global`) and then run it anywhere directly from the terminal.
47
45
 
48
46
  ### 3. CLI flags
49
47
  Command-line flags:
@@ -90,6 +88,7 @@ See the **TypeScript Declarations** at the top of [copy-folder.ts](copy-folder.t
90
88
  - 🎋 [add-dist-header](https://github.com/center-key/add-dist-header):  _Prepend a one-line banner comment (with license notice) to distribution files_
91
89
  - 📄 [copy-file-util](https://github.com/center-key/copy-file-util):  _Copy or rename a file with optional package version number_
92
90
  - 📂 [copy-folder-util](https://github.com/center-key/copy-folder-util):  _Recursively copy files from one folder to another folder_
91
+ - 🪺 [recursive-exec](https://github.com/center-key/recursive-exec):  _Run a command on each file in a folder and its subfolders_
93
92
  - 🔍 [replacer-util](https://github.com/center-key/replacer-util):  _Find and replace strings or template outputs in text files_
94
93
  - 🔢 [rev-web-assets](https://github.com/center-key/rev-web-assets):  _Revision web asset filenames with cache busting content hash fingerprints_
95
94
  - 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util):  _Organize npm scripts into named groups of easy to manage commands_
package/bin/cli.js CHANGED
@@ -10,7 +10,7 @@
10
10
  // },
11
11
  //
12
12
  // Usage from command line:
13
- // $ npm install --global copy-folder-util
13
+ // $ npm install --save-dev copy-folder-util
14
14
  // $ copy-folder build dist
15
15
  // $ copy-folder src/web --ext=.js,.html docs
16
16
  //
@@ -1,4 +1,4 @@
1
- //! copy-folder-util v1.1.0 ~~ https://github.com/center-key/copy-folder-util ~~ MIT License
1
+ //! copy-folder-util v1.1.1 ~~ https://github.com/center-key/copy-folder-util ~~ MIT License
2
2
 
3
3
  export type Settings = {
4
4
  basename: string;
@@ -1,4 +1,4 @@
1
- //! copy-folder-util v1.1.0 ~~ https://github.com/center-key/copy-folder-util ~~ MIT License
1
+ //! copy-folder-util v1.1.1 ~~ https://github.com/center-key/copy-folder-util ~~ MIT License
2
2
 
3
3
  import fs from 'fs';
4
4
  import path from 'path';
@@ -12,7 +12,7 @@ const copyFolder = {
12
12
  cd: null,
13
13
  fileExtensions: [],
14
14
  };
15
- const settings = Object.assign(Object.assign({}, defaults), options);
15
+ const settings = { ...defaults, ...options };
16
16
  const startTime = Date.now();
17
17
  const normalize = (folder) => !folder ? '' : slash(path.normalize(folder)).replace(/\/$/, '');
18
18
  const startFolder = settings.cd ? normalize(settings.cd) + '/' : '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copy-folder-util",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Recursively copy files from one folder to another folder (CLI tool designed for use in npm scripts)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -69,37 +69,38 @@
69
69
  "clean": [
70
70
  "rimraf build dist spec/fixtures/target"
71
71
  ],
72
- "build": [
72
+ "lint": [
73
73
  "jshint . --exclude-path .gitignore",
74
- "eslint --max-warnings 0 . --ext .ts",
74
+ "eslint --max-warnings 0 . --ext .ts"
75
+ ],
76
+ "build": [
75
77
  "tsc",
76
78
  "add-dist-header build dist"
77
79
  ]
78
80
  },
79
81
  "scripts": {
80
- "pretest": "run-scripts clean build",
82
+ "pretest": "run-scripts clean lint build",
81
83
  "test": "mocha spec/*.spec.js"
82
84
  },
83
85
  "dependencies": {
84
- "chalk": "~5.2",
85
- "cli-argv-util": "~1.0",
86
+ "chalk": "~5.3",
87
+ "cli-argv-util": "~1.2",
86
88
  "fancy-log": "~2.0",
87
89
  "slash": "~5.1"
88
90
  },
89
91
  "devDependencies": {
90
92
  "@types/fancy-log": "~2.0",
91
- "@types/node": "~20.3",
92
- "@typescript-eslint/eslint-plugin": "~5.60",
93
- "@typescript-eslint/parser": "~5.60",
94
- "add-dist-header": "~1.0",
95
- "assert-deep-strict-equal": "~1.0",
93
+ "@types/node": "~20.5",
94
+ "@typescript-eslint/eslint-plugin": "~6.4",
95
+ "@typescript-eslint/parser": "~6.4",
96
+ "add-dist-header": "~1.2",
97
+ "assert-deep-strict-equal": "~1.1",
96
98
  "copy-file-util": "~1.1",
97
- "eslint": "~8.43",
99
+ "eslint": "~8.47",
98
100
  "jshint": "~2.13",
99
101
  "mocha": "~10.2",
100
- "rev-web-assets": "~1.1",
101
102
  "rimraf": "~5.0",
102
- "run-scripts-util": "~1.1",
103
+ "run-scripts-util": "~1.2",
103
104
  "typescript": "~5.1"
104
105
  }
105
106
  }