-
Notifications
You must be signed in to change notification settings - Fork 3.4k
docs: Update search #1397
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
Merged
Merged
docs: Update search #1397
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,39 +4,21 @@ redirect_from: | |
- /getting-started/searching-for-packages | ||
--- | ||
|
||
You can use the npm search bar to find packages to use in your projects. npm search uses npms and the npms analyzer; for more information on both, see https://npms.io/about. | ||
You can use the npm search bar to find packages to use in your projects. The search is performed using content from the package's title, description, readme, and keywords and is powered by [opensearch](https://opensearch.org/). Search results are displayed based on keyword matching from the package's title, description, readme, and keywords. No subjective ranking criteria are applied, aiming to provide a neutral stance towards all (non-malicious, non-spam) packages. | ||
|
||
## Searching for a package | ||
|
||
1. In the search bar, type a search term and press **Enter**. As you type, possible choices will appear. | ||
|
||
<Screenshot src="/packages-and-modules/getting-packages-from-the-registry/search-qr.png" alt="Screenshot of a search text box" /> | ||
<Screenshot src="/packages-and-modules/getting-packages-from-the-registry/search-suggestions.png" alt="Screenshot of a search text box with automatic suggestions" /> | ||
|
||
<Screenshot src="/packages-and-modules/getting-packages-from-the-registry/search-qr-results.png" alt="Screenshot of the search text box and search results" /> | ||
<Screenshot src="/packages-and-modules/getting-packages-from-the-registry/search-results.png" alt="Screenshot of the search text box and search results" /> | ||
|
||
2. To list packages ranked according to [package search rank criteria](#package-search-rank-criteria), in the left sidebar, under "Sort packages", click the criterion. For example, to sort packages by popularity, click "Popularity". | ||
2. The results are headed by an approximate count of packages found and a dropdown control for different sorting options. The dropdown offers sorting options like by keyword matching (Default), download counts, most dependents, and last published date to help users refine their search. | ||
|
||
3. In the package search results list, click the name of the package. | ||
|
||
## Package search rank criteria | ||
|
||
Often, there are dozens or even hundreds of packages with similar names and/or similar purposes. To help you decide the best ones to explore, each package has been ranked according to four criteria using the npms analyzer: | ||
|
||
### Popularity | ||
|
||
Popularity indicates how many times the package has been downloaded. This is a strong indicator of packages that others have found to be useful. | ||
|
||
### Quality | ||
<Screenshot src="/packages-and-modules/getting-packages-from-the-registry/search-sort-options.png" alt="Screenshot of the search Sort by dropdown featuring sorting options" /> | ||
|
||
Quality includes considerations such as the presence of a README file, stability, tests, up-to-date dependencies, custom website, and code complexity. | ||
|
||
### Maintenance | ||
|
||
Maintenance ranks packages according to the attention they are given by developers. More frequently maintained packages are more likely to work well with the current or upcoming versions of the npm CLI, for example. | ||
|
||
### Optimal | ||
|
||
Optimal combines the other three criteria (popularity, quality, maintenance) into one score in a meaningful way. | ||
3. In the package search results list, click the name of the package. | ||
|
||
## Package provenance | ||
|
||
|
@@ -69,7 +51,7 @@ To view provenance information for a package in the npm registry: | |
|
||
<Note> | ||
|
||
**Note:** Whenever you access a package's provenance information on npmjs.com, the linked source commit and repository are checked by npm. If the linked source commit or repository cannot be found, an error message will appear at the top of the page and alongside the provenance information. This is to inform you that the provenance for this package can no longer be established, which may occur when a repository is deleted or made private. | ||
**Note:** Whenever you access a package's provenance information on [npmjs.com](https://npmjs.com), the linked source commit and repository are checked by npm. If the linked source commit or repository cannot be found, an error message will appear at the top of the page and alongside the provenance information. This is to inform you that the provenance for this package can no longer be established, which may occur when a repository is deleted or made private. | ||
|
||
<Screenshot src="/packages-and-modules/getting-packages-from-the-registry/[email protected]" alt="Screenshot showing a warning when the provenance source commit or repository cannot be found." /> | ||
|
||
|
Binary file removed
BIN
-50.5 KB
...c/packages-and-modules/getting-packages-from-the-registry/search-qr-results.png
Binary file not shown.
Binary file removed
BIN
-9.71 KB
static/packages-and-modules/getting-packages-from-the-registry/search-qr.png
Binary file not shown.
Binary file added
BIN
+103 KB
static/packages-and-modules/getting-packages-from-the-registry/search-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.1 KB
...packages-and-modules/getting-packages-from-the-registry/search-sort-options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+204 KB
.../packages-and-modules/getting-packages-from-the-registry/search-suggestions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.