node-uploadx
Описание
Node.js middleware for handling resumable uploads
Языки
- TypeScript96,2%
- JavaScript3,8%
node-uploadx
Resumable upload middleware for express and plain node.js. Server-side part of ngx-uploadx
✨ Features
- resumable simple/chunked uploads
- can save files to local filesystem, S3, GCS
- saving added metadata along with files
- logging and error handling
- chunks checksum verification
- file type/size/custom validations
- fixed/rolling expiration and cleanup
- extensibility (custom storages, upload protocols, etc)
🌩️ Installation
All-In-One with cloud storage support:
Separate modules can also be used to save disk space and for faster installation process.:
-
core module:
-
S3 storage support:
♨️ Usage
Express example:
Please navigate to the examples for more.
🛠️ Options
Some available options: :
| option | type | default value | description |
|---|---|---|---|
| | | DiskStorage upload directory |
| | | Storage bucket |
| | | Node http base path |
| | | Allowed MIME types |
| | | File size limit |
| | Provide custom meta storage | |
| | Configure metafiles storage | |
| | | Metadata size limit |
| | Upload validation options | |
| | | Use relative urls |
| | File naming function | |
| | Get user identity | |
| | Callback that is called when a new upload is created | |
| | Callback that is called when an upload is updated | |
| | Callback that is called when an upload is completed | |
| | Callback that is called when an upload is cancelled | |
| | Customize error response | |
| | Configuring the cleanup of abandoned and completed uploads | |
| | | Set built-in logger severity level |
📝 Logging
The library uses for structured logging. Set to enable it, or configure LogTape directly for advanced use cases.
See examples/express-logtape.ts for a complete example.
🔑 Environment Variables
- Secret for salting file/user IDs (set to random string in production).
Contributing
If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are welcome!