1.0.11 ⢠Published 5 months ago
s3-smart-uploader v1.0.11
S3 smart Uploader
A high-performance AWS S3 file uploader with zero memory footprint and signed URL generation for efficient file handling.
š Features
ā Direct-to-S3 Upload: Streams files directly to S3 without loading them into memory.
ā Handles Large Files: Supports multi-part uploads to efficiently upload large files.
ā Presigned URL Generation: Provides temporary, secure access to uploaded files.
ā Minimal RAM Usage: Suitable for memory-constrained environments like serverless functions (AWS Lambda, Vercel, etc.).
ā Easy Integration: Works with Express, Fastify, or any other Node.js web framework.
Installation ##Usage
npm install s3-smart-uploader
š AWS Configuration
Add the following AWS credentials to your .env file:
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_REGION=your-region
AWS_BUCKET_NAME=your-bucket-name
## **Usage**
import { uploadFile } from "my-s3-uploader";
app.post("/upload", async (req, res) => {
try {
const response = await uploadFile(req);
res.json(response);
} catch (error) {
res.status(500).json(error);
}
});