Skip to content

refactor: convert remaining scripts to ESM - #691

Merged
KristjanESPERANTO merged 4 commits into
opening-hours:mainfrom
KristjanESPERANTO:esm
Oct 6, 2026
Merged

KristjanESPERANTO merged 4 commits into
opening-hours:mainfrom
KristjanESPERANTO:esm

Conversation

@KristjanESPERANTO

Copy link
Copy Markdown
Member

With this the last CommonJS scripts are now ES modules. I'm happy to see this milestone done!

package.json stays "type": "commonjs"; that switch would be a separate (not trivial) change.

}
const nominatim_by_loc = {};
for (const nominatim_file of glob.sync('src/holidays/nominatim_cache/*.yaml')) {
for (const nominatim_file of globSync('src/holidays/nominatim_cache/*.yaml')) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we work with native glob? One less dependency...

https://nodejs.org/api/fs.html#fsglobsyncpattern-options

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's nice! I changed it :)

@KristjanESPERANTO
KristjanESPERANTO merged commit 5d7e84c into opening-hours:main Oct 6, 2026
7 checks passed
@KristjanESPERANTO
KristjanESPERANTO deleted the esm branch October 6, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants