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 support for npm package aliases #633

Closed
Cherry opened this issue Mar 4, 2020 · 4 comments · Fixed by #715
Closed

Add support for npm package aliases #633

Cherry opened this issue Mar 4, 2020 · 4 comments · Fixed by #715

Comments

@Cherry
Copy link
Contributor

Cherry commented Mar 4, 2020

npm 6.9.0 added support for aliasing packages in your package.json, so for example, you could install postman-request, but into the request folder as per the syntax below:

"request": "npm:[email protected]"

More references:

As per the example above, I'm using [email protected] which is out of date, but not being detected by ncu. The latest version at time of writing as per https://www.npmjs.com/package/postman-request, is 2.88.1-postman.19.

There's a lot of use-cases for this, but one of the more common ones is actually as I'm describing above - migrating off of an older unmaintained library to another one with an identical API, without making too many code changes. It would be great to see this syntax supported in npm-check-updates.

@raineorshine
Copy link
Owner

Great suggestion. I'm happy to support and provide guidance for a PR for this feature.

@raineorshine
Copy link
Owner

@Cherry @l5x I attempted a fix in #715. Could you try npm install -g [email protected] and see if it works for you?

@Cherry
Copy link
Contributor Author

Cherry commented Aug 10, 2020

@raineorshine Awesome! From some basic testing, things seem to work as I'd expect when using a package alias! Thanks for the feature addition!

@raineorshine
Copy link
Owner

Great, thank you!

I will merge into master and publish to latest once #716 is tested more, since they both entail a major version bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants