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

[RRFC] exportable config definitions #525

Open
fritzy opened this issue Jul 26, 2022 · 0 comments
Open

[RRFC] exportable config definitions #525

fritzy opened this issue Jul 26, 2022 · 0 comments

Comments

@fritzy
Copy link

fritzy commented Jul 26, 2022

As explained in npm/cli#5119

Motivation ("The Why")

@Kytech writes

Since libnpmconfig and the programmatic APIs have been deprecated, there is no library or API provided by NPM that can be consumed by other packages to read NPM's configuration. libnpmconfig has been replaced with @npmcli/config, which cannot read the npm configuration on its own.

In order to allow other programs to read the npm config file using NPM's config resolution algorithm, the definitions in this repository (https://github.com/npm/cli/tree/latest/lib/utils/config) need to be made available.

There are a large number of projects that read the npm config files, but they all have to resort to writing a large amount of the resolution code themselves. Yarn and PNPM provide packages that allow their respective config files to be read by other programs, but since the deprecation of libnpmconfig and the programmatic API, NPM does not have a usable config package (as far as other applications are concerned), which has caused pain points for a number of projects, especially since the recent security issue with rc, which many packages used to roll their own solution, and are now looking to replace as a dependency.

Example

@Kytech mentions being able to retrieve the auth token.

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