-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move from https://github.com/esm-dev/esm.sh
- Loading branch information
0 parents
commit 36815da
Showing
7 changed files
with
1,174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.DS_Store | ||
node_modules/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# esm-compat | ||
|
||
Check the ES module compatibility of a browser. | ||
|
||
## Installation | ||
|
||
``` | ||
npm i esm-compat | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
import { getBuildTargetFromUA } 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 target = getBuildTargetFromUA(ua) | ||
console.log(target) // => es2022 | ||
``` | ||
|
||
## API | ||
|
||
```ts | ||
export const targets: Set<string>; | ||
export const getBuildTargetFromUA: (ua: string | null) => string; | ||
``` | ||
|
||
## License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "esm-compat", | ||
"description": "Checks the ES6 compatibility from a `User-Agent` string", | ||
"version": "0.0.5", | ||
"type": "module", | ||
"module": "dist/compat.js", | ||
"types": "types/compat.d.ts", | ||
"scripts": { | ||
"prepublishOnly": "pnpm run build", | ||
"build": "pnpm esbuild src/compat.ts --outdir=dist --format=esm --platform=browser", | ||
"test": "pnpm run build && node test.mjs" | ||
}, | ||
"files": [ | ||
"dist/compat.js", | ||
"types/compat.d.ts" | ||
], | ||
"devDependencies": { | ||
"@types/ua-parser-js": "0.7.39", | ||
"esbuild": "0.21.5" | ||
}, | ||
"dependencies": { | ||
"ua-parser-js": "^1.0.38" | ||
}, | ||
"repository": "https://github.com/esm-dev/esm-compat", | ||
"license": "MIT" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.