https://github.com/substrate-system/report
Browser report
https://github.com/substrate-system/report
Last synced: 6 months ago
JSON representation
Browser report
- Host: GitHub
- URL: https://github.com/substrate-system/report
- Owner: substrate-system
- License: other
- Created: 2025-03-03T05:26:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-03T06:55:32.000Z (over 1 year ago)
- Last Synced: 2025-03-03T06:56:04.061Z (over 1 year ago)
- Language: TypeScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# report
[](https://github.com/substrate-system/report/actions/workflows/nodejs.yml)
[](README.md)
[](README.md)
[](https://semver.org/)
[](./CHANGELOG.md)
[](package.json)
[](https://packagephobia.com/result?p=@substrate-system/report)
[](https://bundlephobia.com/package/@substrate-system/report)
[](LICENSE)
Get browser & OS info. Based on
[keithws/browser-report](https://github.com/keithws/browser-report).
[See a live demo](https://substrate-system.github.io/report/)
Contents
- [Install](#install)
- [Modules](#modules)
* [ESM](#esm)
* [Common JS](#common-js)
* [pre-built JS](#pre-built-js)
- [Use](#use)
## Install
```sh
npm i -S @substrate-system/report
```
## Modules
This exposes ESM and common JS via
[package.json `exports` field](https://nodejs.org/api/packages.html#exports).
### ESM
```js
import { report } from '@substrate-system/report'
```
### Common JS
```js
const { report } = require('@substrate-system/report')
```
### pre-built JS
This package exposes minified JS files too. Copy them to a location that is
accessible to your web server, then link to them in HTML.
#### copy
```sh
cp ./node_modules/@substrate-system/report/dist/index.min.js ./public/report.min.js
```
#### HTML
```html
```
## Use
```js
import { report } from '@substrate-system/report'
report()
// => { browser: ... }
```
This will return an object like this:
```js
{
"browser": {
"name": "Chrome",
"version": "133.0.0.0"
},
"viewport": {
"width": 1074,
"zoom": 1,
"height": 587,
"layout": {
"width": 1074,
"height": 587
}
},
"cookies": true,
"os": {
"name": "macOS",
"version": "10.15.7"
},
"screen": {
"width": 1440,
"height": 900,
"colors": 30,
"dppx": 2
},
"lang": [
"en-US",
"en"
],
"timestamp": "Sun Mar 02 2025 22:47:36 GMT-0800 (Pacific Standard Time)"
}
```