# multer-express-middleware

> Multer Express Middleware ♻ A weekend project that will help you to easily setup multer with just a middleware. 🌈

Latest version **0.0.3** (published 2021-02-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install multer-express-middleware
pnpm add multer-express-middleware
yarn add multer-express-middleware
bun add multer-express-middleware
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2021-02-20 |
| First published | 2021-02-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 (+11 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Piyush Suthar |
| Maintainers | piyushsuthar |
| Keywords | express, multer, middleware, image store |

## Links

- npm: https://www.npmjs.com/package/multer-express-middleware
- Repository: https://github.com/PiyushSuthar/multer-express-middleware
- Homepage: https://github.com/PiyushSuthar/multer-express-middleware#readme
- Issues: https://github.com/PiyushSuthar/multer-express-middleware/issues
- npm.io page: https://npm.io/package/multer-express-middleware

## Dependencies (2)

- [multer](https://npm.io/package/multer.md) ^1.4.2
- [express](https://npm.io/package/express.md) ^4.17.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2021-02-20
- 0.0.2 — 2021-02-20

## README

<h1 align="center">Multer Express Middleware ♻ </h1>
<p align="center">A weekend project that will help you to easily setup multer with just a middleware. 🌈</p>
<p align="center">
  <a href="https://github.com/PiyushSuthar/image-store-middleware"><img alt="GitHub license" src="https://img.shields.io/github/license/PiyushSuthar/image-store-middleware?style=for-the-badge"></a>
  <a href="https://github.com/PiyushSuthar/image-store-middleware/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/PiyushSuthar/image-store-middleware?style=for-the-badge"></a>
  <a href="https://github.com/PiyushSuthar/image-store-middleware/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/PiyushSuthar/image-store-middleware?style=for-the-badge"></a>
  <img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/piyushsthr?color=%2300acee&logo=twitter&style=for-the-badge">
  
</p>

# Usage 🔥

> Installing the module.
```sh
yarn add multer-express-middleware
```

Using the middleware with Express.
```js
const app = require('express')()
const imageStore = require('multer-express-middleware')

app.use("/api", imageStore({
    // Folder where you would like to save files or images (required)
    destination: "uploads",

    // Property where you would like to set selected image or file while uploading form frontend...
    imageProperty: "image", 

    customize: {
        upload: {
            // field you want to fill while posting an api request... ex "imageFolderName"
            folderProperty: "folder",

            // folder to save image or file
            subFolderProperty: "subfolder" 
            
            // Api path for uploading image or file
            path: "/image/upload" 
        },
        delete: {
            // Property where you would to set image path while giving an post request.
            filePathProperty: "imagePath",

            // API path for deleting image or file
            path: '/image/delete'
        }
    },

    // Custom middlewares, if you wish... ;)
    middlewares: [isSignedIn, isAuthenticated] 
}))
```

> TODO: Need to add some more stuff over here...

## Why made this? 🤔
Just wanted to make something that I could use in all of my MERN Projects. It's a big pain recreating this everytime I start a new project. 😅

## Author

👤 **Piyush Suthar**

* Website: https://piyushsuthar.codes
* Twitter: [@piyushsthr](https://twitter.com/piyushsthr)
* Github: [@piyushsuthar](https://github.com/piyushsuthar)
* LinkedIn: [@piyushsthr](https://linkedin.com/in/piyushsthr)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/PiyushSuthar/image-store-middleware/issues). 

## Show your support

Give a ⭐️ if this project helped you!

---
_Source: https://npm.io/package/multer-express-middleware · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
