Browser detection for express
Go to file
b1ek 3544fc3e49
Fix names in readme
2023-03-28 10:03:48 +10:00
.gitignore base commit 2023-03-18 21:32:08 +10:00
README.md Fix names in readme 2023-03-28 10:03:48 +10:00
index.js add types 2023-03-18 23:10:24 +10:00
package.json add types 2023-03-18 23:10:24 +10:00
types.d.ts add types 2023-03-18 23:10:24 +10:00

README.md

express-browser-detect

This middleware helps you to easily detect the user's browser.

It uses which-browser under the hood, and all the documentation is there

Installation

yarn add --save express-browser-detect

Or if you prefer npm

npm install --save express-browser-detect

Example

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}`);
})