Ⓘ InstallationFirst things first, prepare your Node.js project by installing the following packages if you don’t have them already: $ npm install multer body-parser express morgan crypto -saveHere’s a quick breakdown of what each of these packages do:. Multer: Our image upload library. It handles getting formdata from requests. Body-parser: Extracts the entire body portion of an incoming request stream and exposes it on req.body as something easier to interface with. Express: The very popular web framework that sits on top of Node.js.
morgan: Express middleware for logging network requests. crypto: Deals with cryptography, and has a wide range of other functions, some of which you’ll see hereSetting up the projectHaving added all the necessary modules, we can proceed to setup Multer like this.