Using Promise inside release.config.js #2752
Unanswered
dev-dsp
asked this question in
Configuration
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. I'm writing a configuration for the semantic-release tool using the
release.config.js
file, which should generate the configuration dynamically.Now, I need to call several APIs during the loading process. I found that the best practice for calling APIs is to use
fetch().then()
.My code (simplified) is the following:
The problem here is that in the end
semantic-release
doesn't load that additional plugin.I don't have enough experience with modern NodeJS, so I'm struggling to understand, how to force it to
await
results fromfetch
.I found that in recent Node versions it's possible to use top-level
await
, but simply addingawait
beforefetch
doesn't work for a reason that is unclear to me:So, what is the best way to just perform a couple of synchronous API calls, or await results of all the
fetch
es andthen
s before themodule.exports
?Beta Was this translation helpful? Give feedback.
All reactions