node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »


upload to hash rename expressjs middleware

This middleware renames file uploads to names based on hash of file content


set hash option for bodyParser, include upload-hash-name-middleware (after bodyParser)

var app = express.createServer();
app.use(express.bodyParser({hash: 'md5'}));

that's all now all uploads will be stored by its hashes as name.