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

Version that includes package data alongside package #12

Open
JoshuaKGoldberg opened this issue Dec 20, 2024 · 0 comments
Open

Version that includes package data alongside package #12

JoshuaKGoldberg opened this issue Dec 20, 2024 · 0 comments

Comments

@JoshuaKGoldberg
Copy link

👋 I just was pointed to this package and it's fantastic, thank you for making it!

It would be great if we could also retrieve package data such as version alongside the package. I have a use case where users might ask for a package by name, and it'd be nice to also show them the version.

Since adding it to tryImport would be a big breaking change, how about exporting a new function that returns { imported, package }?

const { imported, package } = await tryImportWithData("my-package");

package.version; // string
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

1 participant