Skip to content

Express.js middleware to clean up uploaded files after multer

License

Notifications You must be signed in to change notification settings

myrotvorets/clean-up-after-multer

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
Oct 9, 2023
Sep 11, 2023
May 11, 2021
Oct 31, 2020
Oct 31, 2020
Oct 31, 2020
Feb 22, 2021
Oct 31, 2020
Oct 31, 2020
Oct 31, 2020
Sep 11, 2023
Apr 10, 2021
Oct 10, 2023
Oct 10, 2023
Apr 20, 2021
Oct 31, 2020

Repository files navigation

clean-up-after-multer

Quality Gate Status Build and Test codebeat badge

Express.js middleware to clean up uploaded files after multer

Usage

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).