https://github.com/esm-dev/esm-compat
Checks the ES6 compatibility from an `User-Agent` string.
https://github.com/esm-dev/esm-compat
Last synced: 12 months ago
JSON representation
Checks the ES6 compatibility from an `User-Agent` string.
- Host: GitHub
- URL: https://github.com/esm-dev/esm-compat
- Owner: esm-dev
- License: mit
- Created: 2024-06-28T11:32:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-03T04:30:48.000Z (over 1 year ago)
- Last Synced: 2025-04-22T13:21:56.745Z (12 months ago)
- Language: TypeScript
- Homepage:
- Size: 29.3 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esm-compat
Check the ES module compatibility of a browser.
## Installation
```
npm i esm-compat
```
## Usage
```js
import { getEsmaVersionFromUA } from "esm-compat"
const ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"
const version = getEsmaVersionFromUA(ua)
console.log(version) // => es2023
```
## License
MIT