Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 400 Bytes

README.md

File metadata and controls

23 lines (15 loc) · 400 Bytes

esm-compat

Check the ES module compatibility of a browser.

Installation

npm i esm-compat

Usage

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