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

npm doesn't use rc #5

Closed
dominictarr opened this issue Nov 21, 2016 · 5 comments
Closed

npm doesn't use rc #5

dominictarr opened this issue Nov 21, 2016 · 5 comments

Comments

@dominictarr
Copy link

you should probably use npm's config module instead of rc

https://www.npmjs.com/package/npm-config

because npm doesn't do exactly the same thing as rc, because of historical reasons, although it may be similar.

where as rc does this:
dominictarr/rc#88 (comment)

but I can't change that because I have no idea what else it might break

@kevva
Copy link
Owner

kevva commented May 23, 2017

npm used to use https://github.com/npm/npmconf but it's documentation clearly states that it shouldn't be used. I'm afraid that changing to another module would introduce other bugs, and apart from this one, I've never encountered any issues.

@dominictarr
Copy link
Author

hmm, it says

However, if you are writing a new Node.js program, and want configuration functionality similar to what npm has, but for your own thing, then I'd recommend using rc, which is probably what you want.

but what you want is to load npm's configuration. rc will not attempt to be fully compatible with npm, because that would be a huge maintenance headache.

Probably the simplest thing would be to depend on npm, but just the configuration loading utilities, and probably lobby the npm crew to maintain their configuration system at a dependable module for other npm related tools to depend on. Obviously extra tooling around npm improves their ecosystem and thus their business so I think this is an easy argument to make.

kevva added a commit that referenced this issue May 23, 2017
@kevva
Copy link
Owner

kevva commented May 23, 2017

Obviously extra tooling around npm improves their ecosystem and thus their business so I think this is an easy argument to make.

Indeed, surprised they moved the config logic into core since it's kinda useful for tools outside of it.

Anyway, I tried using npm directly and as far as I can see it works as intended. Hurts having to depend on it just to get the config though.

@dominictarr
Copy link
Author

you should let them know you are doing this, otherwise they might change the api, maybe not because it's config, but maybe.

@kevva
Copy link
Owner

kevva commented Jul 21, 2017

Fixed in 2869a17.

@kevva kevva closed this as completed Jul 21, 2017
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