https://github.com/zaida04/multer-cloudflare-storage
🚀 Multer engine for Cloudflare Images with ease.
https://github.com/zaida04/multer-cloudflare-storage
multer multer-library multer-storage
Last synced: about 1 year ago
JSON representation
🚀 Multer engine for Cloudflare Images with ease.
- Host: GitHub
- URL: https://github.com/zaida04/multer-cloudflare-storage
- Owner: zaida04
- License: mit
- Created: 2021-11-23T01:29:06.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-27T01:57:51.000Z (over 2 years ago)
- Last Synced: 2025-04-16T00:13:07.067Z (about 1 year ago)
- Topics: multer, multer-library, multer-storage
- Language: TypeScript
- Homepage:
- Size: 18.6 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# `multer-cloudflare-storage`
[](https://github.com/zaida04/multer-cloudflare-storage/blob/main/LICENSE)
[](https://www.npmjs.com/package/multer-cloudflare-storage)
[](https://github.com/zaida04/multer-cloudflare-storage/actions/workflows/ci.yml)
## 📥 Installation
You can install this package from [NPM](https://www.npmjs.com/package/multer-cloudflare-storage)
- `npm install multer-cloudflare-storage`
- `yarn add multer-cloudflare-storage`
## ⚡ Usage
```typescript
import express, { Request, Response } from "express";
import multer from "multer";
import { CloudflareStorage } from "multer-cloudflare-storage";
const app = express();
const uploader = multer({
storage: new CloudflareStorage("YOUR_CLOUDFLARE_ACCOUNT_ID_HERE", "YOUR_CLOUDFLARE_ACCOUNT_TOKEN_HERE")
});
app.post("/", uploader.single("image"), (req: Request, _res: Response) => {
console.log(req.file);
// {
// fieldname: 'image',
// originalname: 'PLACEHOLDER_IMAGE_NAME.jiff',
// encoding: '7bit',
// mimetype: 'application/octet-stream',
// path: 'https://imagedelivery.net/PLACEHOLDER_ACCOUNT_ID/PLACEHOLDER_IMAGE_ID/public',
// filename: null,
// destination: 'PLACEHOLDER_IMAGE_ID'
// }
});
```
You can find a working example of an Express server with multer and this package [here](https://github.com/zaida04/multer-cloudflare-storage/blob/main/example/src/index.ts)
## ✋ Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
Please ensure any and all commits pass our tests, linting, and build steps as described in the root package.json.
## ⚖️ LICENSE
Licensed under the [MIT License](https://github.com/zaida04/multer-cloudflare-storage/blob/main/LICENSE)