This is a simple Express application that detects the user's browser, operating system, platform, and device model based on the User-Agent string.
- Detects browser name
- Identifies operating system
- Determines platform (mobile or desktop)
- Gets device model (if applicable)
- Node.js
- Express
- UA-Parser-JS
-
Clone the repository:
git clone https://github.com/drealdumore/lightweight-browser-detector cd lightweight-browser-detector -
Install the required dependencies:
npm install express ua-parser-js
-
Start the server:
node index.js
-
Open your browser and navigate to
http://localhost:3000. If port 3000 is in use, the application will automatically switch to the next available port. -
The browser will return a JSON response with the following structure:
{ "browser": "Chrome", "os": "iOS", "platform": "mobile", "model": "iPhone" }
Feel free to fork the repository and submit pull requests for improvements or features.
This project is licensed under the MIT License.