1 ---
2 title: npm-search
3 section: 1
4 description: Search for packages
5 github_repo: npm/cli
6 github_branch: release/v6
7 github_path: docs/content/commands/npm-search.md
8 redirect_from:
9 - /cli-documentation/v6/cli-commands/npm-search
10 - /cli-documentation/v6/cli-commands/search
11 - /cli-documentation/v6/commands/npm-search
12 - /cli-documentation/v6/commands/search
13 - /cli-documentation/v6/npm-search
14 - /cli-documentation/v6/search
15 - /cli/v6/cli-commands/npm-search
16 - /cli/v6/cli-commands/search
17 - /cli/v6/commands/search
18 - /cli/v6/npm-search
19 - /cli/v6/search
20 ---
21
22 ### Synopsis
23
24 ```bash
25 npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...]
26
27 aliases: s, se, find
28 ```
29
30 ### Description
31
32 Search the registry for packages matching the search terms. `npm search` performs a linear, incremental, lexically-ordered search through package metadata for all files in the registry. If color is enabled, it will further highlight the matches in the results.
33
34 Additionally, using the `--searchopts` and `--searchexclude` options paired with more search terms will respectively include and exclude further patterns. The main difference between `--searchopts` and the standard search terms is that the former does not highlight results in the output and can be used for more fine-grained filtering. Additionally, both of these can be added to `.npmrc` for default search filtering behavior.
35
36 Search also allows targeting of maintainers in search results, by prefixing their npm username with `=`.
37
38 If a term starts with `/`, then it's interpreted as a regular expression and supports standard JavaScript RegExp syntax. A trailing `/` will be ignored in this case. (Note that many regular expression characters must be escaped or quoted in most shells.)
39
40 ### A Note on caching
41
42 ### Configuration
43
44 #### description
45
46 - Default: true
47 - Type: Boolean
48
49 Used as `--no-description`, disables search matching in package descriptions and suppresses display of that field in results.
50
51 #### json
52
53 - Default: false
54 - Type: Boolean
55
56 Output search results as a JSON array.
57
58 #### parseable
59
60 - Default: false
61 - Type: Boolean
62
63 Output search results as lines with tab-separated columns.
64
65 #### long
66
67 - Default: false
68 - Type: Boolean
69
70 Display full package descriptions and other long text across multiple lines. When disabled (default) search results are truncated to fit neatly on a single line. Modules with extremely long names will fall on multiple lines.
71
72 #### searchopts
73
74 - Default: ""
75 - Type: String
76
77 Space-separated options that are always passed to search.
78
79 #### searchexclude
80
81 - Default: ""
82 - Type: String
83
84 Space-separated options that limit the results from search.
85
86 #### searchstaleness
87
88 - Default: 900 (15 minutes)
89 - Type: Number
90
91 The age of the cache, in seconds, before another registry request is made.
92
93 #### registry
94
95 - Default: https://registry.npmjs.org/
96 - Type: url
97
98 Search the specified registry for modules. If you have configured npm to point to a different default registry, such as your internal private module repository, `npm search` will default to that registry when searching. Pass a different registry url such as the default above in order to override this setting.
99
100 ### See Also
101
102 - [npm registry](/cli/v6/using-npm/registry)
103 - [npm config](/cli/v6/commands/npm-config)
104 - [npmrc](/cli/v6/configuring-npm/npmrc)
105 - [npm view](/cli/v6/commands/npm-view)