Skip to content

Commit

Permalink
ESM support (#784)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Mcgrath <[email protected]>
Co-authored-by: Adam Mcgrath <[email protected]>
  • Loading branch information
3 people authored Mar 14, 2023
1 parent 6ab5834 commit a143a36
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
es2017: true,
mocha: true,
},
ignorePatterns: ['**/*.mjs'],
extends: [
'eslint:recommended',
'plugin:jsdoc/recommended',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "3.2.0",
"description": "SDK for Auth0 API v2",
"main": "src/index.js",
"module": "src/index.mjs",
"sideEffects": false,
"files": [
"src"
Expand Down
11 changes: 11 additions & 0 deletions src/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
/**
* Simple facade for consuming a REST API endpoint.
*
* @external RestClient
* {@link https://github.com/ngonzalvez/rest-facade}
*/
export const ManagementClient = require('./management');
export const AuthenticationClient = require('./auth');
export default { ManagementClient, AuthenticationClient }

0 comments on commit a143a36

Please sign in to comment.