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

Working with conditional exports #141

Closed
BasixKOR opened this issue Oct 13, 2022 · 2 comments
Closed

Working with conditional exports #141

BasixKOR opened this issue Oct 13, 2022 · 2 comments

Comments

@BasixKOR
Copy link

Hello! I'm working on a package that depends on the WebCrypto API, and I'd like to use require('node:crypto').webcrypto conditionally on Node.js environments.

Although my use case is quite a niche, I think using conditional exports enables useful things that weren't possible before: using N-API bindings on Node.js, providing Node.js-specific APIs and more.

Would you consider adding this feature? I'm not sure about the design, but I'm thinking something like a constant with the matched condition.

@huozhi
Copy link
Owner

huozhi commented Oct 14, 2022

Hey! Would you like to elaborate a bit with more code snippet for the example? Like what kind of condition exports and how will be it used on consumer side?

@huozhi
Copy link
Owner

huozhi commented Feb 19, 2023

Close as outdated, code sample is needed here

@huozhi huozhi closed this as completed Feb 19, 2023
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

No branches or pull requests

2 participants