@kne/fastify-file-manager 3.0.0-alpha.1 → 3.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.
@@ -83,7 +83,7 @@ module.exports = fp(async (fastify, fastifyOptions) => {
83
83
  }
84
84
 
85
85
  //清除临时文件
86
- await fs.remove(tmpPath);
86
+ fs.remove(tmpPath).catch(console.error);
87
87
 
88
88
  const outputFile = await (async create => {
89
89
  if (!id) {
@@ -364,10 +364,10 @@ module.exports = fp(async (fastify, fastifyOptions) => {
364
364
  compressStream.addEntry(path.resolve(filepath));
365
365
  });
366
366
  compressStream.on('error', () => {
367
- fs.remove(tmpPath);
367
+ fs.remove(tmpPath).catch(console.error);
368
368
  });
369
369
  compressStream.on('end', () => {
370
- fs.remove(tmpPath);
370
+ fs.remove(tmpPath).catch(console.error);
371
371
  });
372
372
  return compressStream;
373
373
  };
@@ -416,9 +416,7 @@ module.exports = fp(async (fastify, fastifyOptions) => {
416
416
  };
417
417
  })
418
418
  );
419
- //清除临时文件
420
- await fs.remove(tmpPath);
421
-
419
+ fs.remove(tmpPath).catch(console.error);
422
420
  return fileList;
423
421
  };
424
422
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kne/fastify-file-manager",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0",
4
4
  "description": "用于管理静态文件上传查看等",
5
5
  "main": "index.js",
6
6
  "scripts": {