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

Require with extension for json files #285

Closed
wants to merge 1 commit into from

Conversation

alexandrusavin
Copy link

@alexandrusavin alexandrusavin commented Mar 23, 2017

Packaging apps (webpack etc.) default to js extensions.

Transpilers (webpack etc.) default to js extensions.
@sindresorhus
Copy link
Owner

Sorry, I'm not going to change something because of Webpack. It's up to Webpack to support the Node.js ecosystem. Open an issue on Webpack ;)

@alextes
Copy link
Contributor

alextes commented Mar 23, 2017

Why not use read-pkg @sindresorhus?
I like reading JSON to be explicit, but that's just intuition.
Interestingly both read-pkg and load-json-file are yours. It's beside the point for this PR, but now I'm curious. Care to elaborate why we don't use them for got?

@sindresorhus
Copy link
Owner

@alextes require works perfectly for this use-case. We want to read the package.json once and cache it for the lifetime of the process. read-pkg would read it for every Got usage. require is also faster and less dependencies.

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.

None yet

3 participants