clean-up-after-multer 1.1.9
Install from the command line:
Learn more about npm packages
$ npm install @myrotvorets/clean-up-after-multer@1.1.9
Install via package.json:
"@myrotvorets/clean-up-after-multer": "1.1.9"
About this version
Express.js middleware to clean up uploaded files after multer
import express from 'express';
import { cleanUploadedFilesMiddleware } from '@myrotvorets/clean-up-after-multer'
const app = express();
app.use(/* your middlewares here */);
app.use(cleanUploadedFilesMiddleware());
Make sure to call next()
from your middlewares.
cleanUploadedFilesMiddleware()
accepts an argument of type (path: string) => Promise<unknown>
to specify the custom unlink()
function (in case you want to log unlink failures etc).