ES6 Modules with grant
See original GitHub issueHi. Thanks for making grant
. I tried it and it works well for many OAuth2 providers.
One question I had was regarding support for ES Modules. While I understand from the issues that you have decided not to support Typescript, I was wondering how to import grant as a ES6 module.
While require('grant').fastify();
works, I wanted to go the standard route since require
is not a standard and definitely not recommended in the future for Node.js with mjs
support now in place.
Issue Analytics
- State:
- Created 3 years ago
- Comments:23 (11 by maintainers)
Top Results From Across the Web
JavaScript ES6 Modules Import Export
ES6 Module import export business in JavaScript and JS Legacy Code ... JS will take this for granted and you can run the...
Read more >Include es6 module support · Issue #97 · nodeca/pako - GitHub
All modern browsers now support es6 modules (except chrome which will land shortly). ... Granted these may be more "bleading-edge" than "modern".
Read more >ES Modules in Cloud Functions - Medium
ES modules (aka ECMAScript modules or ESM) are a TC39 standard, unflagged feature in Node≥14 for loading JavaScript modules.
Read more >JavaScript modules - MDN Web Docs
This guide gives you all you need to get started with JavaScript module syntax.
Read more >How to use an ES modules aggregator file - Educative.io
An aggregator file is a script we solely use to import and re-export the exported items of other modules. In other words, instead...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the help @tvvignesh, I really appreciate it 👍
Ok, published v5.4.8 with the last two fixes. You should be able to use the
strict
option now without patching theGrantConfig
. As for theesModuleInterop
that totally makes sense, I used that option myself, but I also added the.default
import that you suggested.