Skip to content

Commit

Permalink
feat: added support for ESM (ECMAScript modules)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: due to added ESM module support Node.js version with
ESM implementation bugs are no longer supported, this only affects early
v13.x versions. The resulting Node.js semver range is
`>=10.13.0 < 13 || >=13.7.0`
  • Loading branch information
panva committed Sep 8, 2020
1 parent 6c35c51 commit 1aa9035
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- 11
- 12.0.0
- 12
- 13.0.0
- 13.7.0
- 13
- 14.0.0
- 14
Expand Down
9 changes: 9 additions & 0 deletions lib/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import mod from './index.js'

export default mod
export const JWE = mod.JWE
export const JWK = mod.JWK
export const JWKS = mod.JWKS
export const JWS = mod.JWS
export const JWT = mod.JWT
export const errors = mod.errors
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,22 @@
"funding": "https://github.com/sponsors/panva",
"license": "MIT",
"author": "Filip Skokan <[email protected]>",
"exports": {
"import": "./lib/index.mjs",
"require": "./lib/index.js"
},
"main": "lib/index.js",
"types": "types/index.d.ts",
"files": [
"lib/**/*.js",
"LICENSE_THIRD_PARTY",
"types/index.d.ts"
],
"main": "lib/index.js",
"types": "types/index.d.ts",
"scripts": {
"coverage": "c8 ava",
"lint": "standard",
"lint-ts": "npx typescript@~3.6.0 --build types",
"lint-fix": "standard --fix",
"lint-ts": "npx typescript@~3.6.0 --build types",
"test": "ava",
"watch": "ava --watch"
},
Expand Down Expand Up @@ -90,7 +94,7 @@
"standard": "^14.3.1"
},
"engines": {
"node": ">=10.13.0"
"node": ">=10.13.0 < 13 || >=13.7.0"
},
"standard": {
"parser": "babel-eslint"
Expand Down

0 comments on commit 1aa9035

Please sign in to comment.