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

Proposal: change api #13

Closed
fisker opened this issue Sep 27, 2019 · 5 comments
Closed

Proposal: change api #13

fisker opened this issue Sep 27, 2019 · 5 comments

Comments

@fisker
Copy link
Contributor

fisker commented Sep 27, 2019

You renamed .package in 8140c73 .

But why not readPkgUp and readPkgUp.sync for the json, add readPkgUp.resolve and readPkgUp.resolve.sync to get the path, just like require

@fisker fisker changed the title Proposal: change ap Proposal: change api Sep 27, 2019
@sindresorhus
Copy link
Owner

What if you want both at the same time? Then it would have to search twice, which could also cause race conditions.

@fisker
Copy link
Contributor Author

fisker commented Sep 27, 2019

I would do readPkgUp.resolve get the path then require or readjson

Just like I usually do with require, require.resolve then require

@sindresorhus
Copy link
Owner

Then I would have to document how to use it properly and people will still not read it and do it wrong. With destructuring, the current API is fine, IMHO.

@fisker
Copy link
Contributor Author

fisker commented Sep 27, 2019

Sure, just suggestion.

@sindresorhus
Copy link
Owner

Another reason not to do it is that I just did two major versions for silly stuff, so I don't really want to cause more churn.

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