connect-busboy is a middleware for Node.js Connect and Express applications, designed to parse `multipart/form-data` requests, primarily for file uploads and complex form data. It acts as a wrapper around the powerful, streaming `busboy` parser, providing a simpler API for integration into the middleware stack. The current stable version is 1.0.0. The package has seen no updates in over four years (last published April 2022), indicating a maintenance-only status with a very slow release cadence. While it provides a straightforward way to handle multipart requests, more actively maintained alternatives like `multer` or `express-fileupload` are often preferred for modern Express applications due to ongoing support and feature development.
npm install connect-busboyVerified import paths — ran on the pinned version, not inferred.
This quickstart sets up an Express server to handle file uploads using connect-busboy, demonstrating how to configure middleware options, listen for file and field events, and save uploaded files to disk.
For new projects or if active maintenance is crucial, consider alternatives like `multer` or `express-fileupload`.
Ensure your Node.js version is >=10.16.0. Update event handler signatures for `file` and `field` events to destructure the `info` object for properties like `filename` and `mimeType` instead of separate arguments.
Always check for `if (req.busboy)` before attempting to use it. Ensure client requests use appropriate HTTP methods (e.g., POST) and `Content-Type` headers for multipart data. Refer to the 'Troubleshooting' section in the package README.
Verify that the HTTP request method is not GET or HEAD, the 'Content-Type' header is set to 'multipart/form-data' or 'application/x-www-form-urlencoded', and 'Content-Length' is defined or chunked transfer encoding is used. Add a check `if (req.busboy) { ... }` before using it.