Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myrotvorets/clean-up-after-multer
Express.js middleware to clean up uploaded files after multer
https://github.com/myrotvorets/clean-up-after-multer
cleanup express-js express-middleware expressjs middleware multer
Last synced: about 1 month ago
JSON representation
Express.js middleware to clean up uploaded files after multer
- Host: GitHub
- URL: https://github.com/myrotvorets/clean-up-after-multer
- Owner: myrotvorets
- License: mit
- Created: 2020-10-31T15:45:40.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-15T16:52:41.000Z (8 months ago)
- Last Synced: 2024-04-15T23:03:57.327Z (8 months ago)
- Topics: cleanup, express-js, express-middleware, expressjs, middleware, multer
- Language: TypeScript
- Homepage:
- Size: 2.09 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clean-up-after-multer
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=myrotvorets_clean-up-after-multer&metric=alert_status)](https://sonarcloud.io/dashboard?id=myrotvorets_clean-up-after-multer)
[![Build and Test](https://github.com/myrotvorets/clean-up-after-multer/actions/workflows/build.yml/badge.svg)](https://github.com/myrotvorets/clean-up-after-multer/actions/workflows/build.yml)
[![codebeat badge](https://codebeat.co/badges/6b4170d0-a573-40bf-b9bb-2e2d6701247a)](https://codebeat.co/projects/github-com-myrotvorets-clean-up-after-multer-master)Express.js middleware to clean up uploaded files after multer
# Usage
```typescript
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` to specify the custom `unlink()` function (in case you want to log unlink failures etc).