It uses which-browser under the hood, and all the documentation is there
yarn add --save express-browser-detect
Or if you prefer npm
npm install --save express-browser-detect
const express = require('express');
const app = express();
const port = 3000;
const ex_browser = require('express-browser-detect');
app.use(ex_browser);
app.get('/', (req, res) => {
res.send('Your browser is: ' + req.browser.browser.toString());
})
app.listen(port, () => {
console.log(`Example app listening on port ${port}`);
})