表达形象快速中间件可帮助您调整图像大小安装npm i express-image例子var express = require ( 'express' ) ; var image = require ( 'express-image' ) ; var app = express ( ) ; app . use ( '/imgs' , image ( __dirname ) ) ; app . listen ( 3000 ) ;现在您可以请求localhost获取调整大小的图像http://localhost:3000/imgs/sample.jpg?w=40将图像调整为40px的宽度,同时保持纵横比http://localhost:3000/imgs/sample.jpg?h=40在保持纵横比的同时将图像调整为40px的高度http://localhost