1 ---
2 title: npm-search
3 section: 1
4 description: Search for packages
5 github_repo: npm/cli
6 github_branch: latest
7 github_path: docs/lib/content/commands/npm-search.md
8 redirect_from:
9 - /cli-commands/npm-search
10 - /cli-commands/search
11 - /cli-documentation/cli-commands/npm-search
12 - /cli-documentation/cli-commands/search
13 - /cli-documentation/commands/npm-search
14 - /cli-documentation/commands/search
15 - /cli-documentation/npm-search
16 - /cli-documentation/search
17 - /cli-documentation/v10/cli-commands/npm-search
18 - /cli-documentation/v10/cli-commands/search
19 - /cli-documentation/v10/commands/npm-search
20 - /cli-documentation/v10/commands/search
21 - /cli-documentation/v10/npm-search
22 - /cli-documentation/v10/search
23 - /cli/cli-commands/npm-search
24 - /cli/cli-commands/search
25 - /cli/commands/npm-search
26 - /cli/commands/search
27 - /cli/npm-search
28 - /cli/search
29 - /cli/v10/cli-commands/npm-search
30 - /cli/v10/cli-commands/search
31 - /cli/v10/commands/search
32 - /cli/v10/npm-search
33 - /cli/v10/search
34 - /commands/npm-search
35 - /commands/search
36 ---
37
38 ### Synopsis
39
40 ```bash
41 npm search <search term> [<search term> ...]
42
43 aliases: find, s, se
44 ```
45
46 Note: This command is unaware of workspaces.
47
48 ### Description
49
50 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 your terminal has color support, it will further highlight the matches in the results. This can be disabled with the config item `color`
51
52 Additionally, using the `--searchopts` and `--searchexclude` options paired with more search terms will 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 you can use them more fine-grained filtering. Additionally, you can add both of these to your config to change default search filtering behavior.
53
54 Search also allows targeting of maintainers in search results, by prefixing their npm username with `=`.
55
56 If a term starts with `/`, then it's interpreted as a regular expression and supports standard JavaScript RegExp syntax. In this case search will ignore a trailing `/` . (Note you must escape or quote many regular expression characters in most shells.)
57
58 ### Configuration
59
60 #### `json`
61
62 - Default: false
63 - Type: Boolean
64
65 Whether or not to output JSON data, rather than the normal output.
66
67 - In `npm pkg set` it enables parsing set values with JSON.parse() before saving them to your `package.json`.
68
69 Not supported by all npm commands.
70
71 #### `color`
72
73 - Default: true unless the NO_COLOR environ is set to something other than '0'
74 - Type: "always" or Boolean
75
76 If false, never shows colors. If `"always"` then always shows colors. If true, then only prints color codes for tty file descriptors.
77
78 #### `parseable`
79
80 - Default: false
81 - Type: Boolean
82
83 Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format.
84
85 #### `description`
86
87 - Default: true
88 - Type: Boolean
89
90 Show the description in `npm search`
91
92 #### `searchlimit`
93
94 - Default: 20
95 - Type: Number
96
97 Number of items to limit search results to. Will not apply at all to legacy searches.
98
99 #### `searchopts`
100
101 - Default: ""
102 - Type: String
103
104 Space-separated options that are always passed to search.
105
106 #### `searchexclude`
107
108 - Default: ""
109 - Type: String
110
111 Space-separated options that limit the results from search.
112
113 #### `registry`
114
115 - Default: "https://registry.npmjs.org/"
116 - Type: URL
117
118 The base URL of the npm registry.
119
120 #### `prefer-online`
121
122 - Default: false
123 - Type: Boolean
124
125 If true, staleness checks for cached data will be forced, making the CLI look for updates immediately even for fresh package data.
126
127 #### `prefer-offline`
128
129 - Default: false
130 - Type: Boolean
131
132 If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server. To force full offline mode, use `--offline`.
133
134 #### `offline`
135
136 - Default: false
137 - Type: Boolean
138
139 Force offline mode: no network requests will be done during install. To allow the CLI to fill in missing cache data, see `--prefer-offline`.
140
141 ### See Also
142
143 - [npm registry](/cli/v10/using-npm/registry)
144 - [npm config](/cli/v10/commands/npm-config)
145 - [npmrc](/cli/v10/configuring-npm/npmrc)
146 - [npm view](/cli/v10/commands/npm-view)
147 - [npm cache](/cli/v10/commands/npm-cache)
148 - https://npm.im/npm-registry-fetch