openfga / js-sdk

OpenFGA SDK for node.js and JavaScript - https://www.npmjs.com/package/@openfga/sdk
https://openfga.dev
Apache License 2.0
50 stars 11 forks source link

Support for ESM Modules #128

Open rhamzeh opened 2 months ago

rhamzeh commented 2 months ago

Please do not report security vulnerabilities here. See the Responsible Disclosure Program.

Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible.

By submitting an issue to this repository, you agree to the terms within the OpenFGA Code of Conduct.

Describe the problem you'd like to have solved

We currently only support CommonJS, the industry is moving forward in support for ESM modules. We should migrate to ESM Modules but still find a way to support CommonJS for those who haven't migrated yet

Additional context

https://nodejs.org/api/esm.html https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/ https://jestjs.io/docs/ecmascript-modules https://the-guild.dev/blog/support-nodejs-esm https://blog.logrocket.com/publishing-node-modules-typescript-es-modules/