question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[json] package.json: complete package versions from scopes or private registries

See original GitHub issue

While there are numerous issues explaining that package names cannot be autocompleted for scopes on the official registry or for private registries, that doesn’t mean you shouldn’t be able to autocomplete package versions.

And I’d argue that atleast for private registries autocompleting the version is generally more important than autocompleting the name. The name is usually well known for internal dependencies. But the version range available; that not so much…

Anyway, for scoped packages and even for scopes that are redirected to other registries using registry entries in .npmrc, the versions can be gotten from a simple npm view command, which returns a JSON structure that also holds all of a package’s versions. No reason the functionality for that command couldn’t be tapped for autocompletion as well.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:12
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
austinhcommented, Jan 27, 2020

Ive tried to follow the various issues mentioned in here but it does not seem that there has been a conclusion on this issue. It seems like many people assume this is an extension, but actually its not and its provided by core functionality, is that correct?

I would love this feature and think it would be an excellent addition to vscode.

2reactions
aeschlicommented, Jul 17, 2018

Probably the best would be to call npm as a command so we get the version the user has configured.

Read more comments on GitHub >

github_iconTop Results From Across the Web

package.json - npm Docs
See scope for more detail. version. If you plan to publish your package, the most important things in your package.json are the name...
Read more >
npm.fetchOnlinePackageInfo with private registry #111254
packages from a private registry are not supported. ... [json] package.json: complete package versions from scopes or private registries ...
Read more >
How to have npm dependencies from different registries in the ...
To have dependencies from different registries referred in same package.json, npm recommends to use scope. Scoped packages will look like
Read more >
npm - Understanding Scoped Packages - Nitay Neeman's Blog
This article explains what scopes are in regard to npm packages ... use npm init --scope=sample-scope , which creates a package.json file ...
Read more >
package.json - Yarn
Essentials. The two most important fields in your package.json are name and version , without them your package won't be able to install....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found