auto-image-converter 1.0.8 → 1.0.10

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.
@@ -3,4 +3,5 @@ export default {
3
3
  format: "webp",
4
4
  quality: 80,
5
5
  removeOriginal: true,
6
+ recursive: true,
6
7
  };
package/lib/converter.js CHANGED
@@ -5,15 +5,23 @@ import path from "node:path";
5
5
 
6
6
  const supportedExt = [".png", ".jpg", ".jpeg"];
7
7
 
8
- export async function convertImages({ dir, format, quality, removeOriginal }) {
8
+ export async function convertImages({
9
+ dir,
10
+ format,
11
+ quality,
12
+ recursive,
13
+ removeOriginal,
14
+ }) {
9
15
  const pattern = recursive
10
16
  ? `${dir}/**/*.{png,jpg,jpeg}`
11
17
  : `${dir}/*.{png,jpg,jpeg}`;
12
18
  const files = await fg(pattern);
19
+ console.log("нашел файлы", files);
13
20
 
14
21
  for (const file of files) {
15
22
  const ext = path.extname(file);
16
23
  const outFile = file.replace(ext, `.${format}`);
24
+ console.log(`Записываю файл: ${outFile}`);
17
25
 
18
26
  const image = sharp(file);
19
27
  const buffer =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auto-image-converter",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "auto-convert-images": "./bin/index.js"