Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support require() attributes #12

Merged
merged 4 commits into from
Oct 11, 2024
Merged

Support require() attributes #12

merged 4 commits into from
Oct 11, 2024

Conversation

kasperisager
Copy link
Contributor

This makes require() a synchronous equivalent to import() with both supporting an options object as a second argument:

require('./foo.json', { with: { type: 'json' } })
await import('./foo.json', { with: { type: 'json' } })

@kasperisager kasperisager merged commit c648e63 into main Oct 11, 2024
3 checks passed
@kasperisager kasperisager deleted the require-assertions branch October 11, 2024 11:04
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.

1 participant