import 'multer'
import * as sharp from 'sharp'
-import { unlinkPromise } from './core-utils'
+import { remove } from 'fs-extra'
async function processImage (
- physicalFile: Express.Multer.File,
+ physicalFile: { path: string },
destination: string,
newSize: { width: number, height: number }
) {
.resize(newSize.width, newSize.height)
.toFile(destination)
- await unlinkPromise(physicalFile.path)
+ await remove(physicalFile.path)
}
// ---------------------------------------------------------------------------