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

Add index.js to allow the package to be resolved via require.resolve #22

Closed
wants to merge 3 commits into from

Conversation

h2non
Copy link
Contributor

@h2non h2non commented Jan 16, 2016

No description provided.

@h2non
Copy link
Contributor Author

h2non commented Jan 16, 2016

@dead-horse I would appreciate if you can merge and release a new version. This is a blocking issue for me that doesn't allow me to resolve this package.

@jonathanong
Copy link
Contributor

why, though?

@rstacruz
Copy link
Contributor

Require.resolve('mz/fs') should work.

On Saturday, January 16, 2016, jongleberry notifications@github.com wrote:

why, though?


Reply to this email directly or view it on GitHub
#22 (comment).

@h2non
Copy link
Contributor Author

h2non commented Jan 16, 2016

I'm not able to resolve the package as require.resolve('mz').
The point is, why not? It's useful to have a main module and it follows the module resolution convention in the node ecosystem to behave consistently.

In order to be resolved by node lookup algorithm there's only needed one main module.
It might be also as simple as index.js with module.exports = {}.

@LinusU
Copy link
Contributor

LinusU commented Jan 16, 2016

This seems reasonable for me

module.exports = {
fs: require('./fs'),
dns: require('./dns'),
zlid: require('./zlib'),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: s/zlid/zlib/

@targos
Copy link

targos commented Jan 16, 2016

It doesn't make any harm.
If you go for it, don't forget to add index.js in the files array here: https://github.com/normalize/mz/blob/master/package.json#L35-L42

@h2non
Copy link
Contributor Author

h2non commented Jan 16, 2016

Fixed typo and updated package.json.

@LinusU
Copy link
Contributor

LinusU commented Jan 16, 2016

Could you please squash the commits?

@dead-horse
Copy link
Member

landed in 1400fa5

@dead-horse dead-horse closed this Jan 24, 2016
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

6 participants