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

Should it be module.parent.parent? #1

Open
phillee opened this issue Sep 6, 2014 · 3 comments
Open

Should it be module.parent.parent? #1

phillee opened this issue Sep 6, 2014 · 3 comments

Comments

@phillee
Copy link

phillee commented Sep 6, 2014

Currently, parent-require calls require in module.parent, which is the calling module.

However since it's "parent-require" I think it should be looking in the module's parent, which is module.parent.parent

@phillee
Copy link
Author

phillee commented Sep 6, 2014

Forked it here: https://github.com/Healtho/node-parent-require. It's working well for me and solves some nasty dev-time peerDependency issues, let me know what you think.

@jaredhanson
Copy link
Owner

That would be grandparent, not parent. Can you provide some details on the situation you are encountering and describe the problem in more detail?

Sent from my iPhone

On Sep 6, 2014, at 1:48 AM, Philip Lee notifications@github.com wrote:

Currently, parent-require calls require in module.parent, which is the calling module.

However since it's "parent-require" I think it should be looking in the module's parent, which is module.parent.parent


Reply to this email directly or view it on GitHub.

@phillee
Copy link
Author

phillee commented Sep 6, 2014

Using the Readme example:

  • my-app
    • requires mongoose-schemas-users
      • requires parent-require < my-app is grandparent here

I believe the goal is to have my-app (the parent) require mongoose. With the above setup, from parent-require, module.parent is mongoose-schema-users and module.parent.parent is my-app.

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