1 ---
2 title: npm-search
3 section: 1
4 description: Search for packages
5 github_repo: npm/cli
6 github_branch: release/v7
7 github_path: docs/content/commands/npm-search.md
8 redirect_from:
9 - /cli-documentation/v7/cli-commands/npm-search
10 - /cli-documentation/v7/cli-commands/search
11 - /cli-documentation/v7/commands/npm-search
12 - /cli-documentation/v7/commands/search
13 - /cli-documentation/v7/npm-search
14 - /cli-documentation/v7/search
15 - /cli/v7/cli-commands/npm-search
16 - /cli/v7/cli-commands/search
17 - /cli/v7/commands/search
18 - /cli/v7/npm-search
19 - /cli/v7/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 Note: This command is unaware of workspaces.
31
32 ### Description
33
34 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`
35
36 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.
37
38 Search also allows targeting of maintainers in search results, by prefixing their npm username with `=`.
39
40 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.)
41
42 ### Configuration
43
44 #### `long`
45
46 - Default: false
47 - Type: Boolean
48
49 Show extended information in `ls`, `search`, and `help-search`.
50
51 #### `json`
52
53 - Default: false
54 - Type: Boolean
55
56 Whether or not to output JSON data, rather than the normal output.
57
58 - In `npm pkg set` it enables parsing set values with JSON.parse() before saving them to your `package.json`.
59
60 Not supported by all npm commands.
61
62 #### `color`
63
64 - Default: true unless the NO_COLOR environ is set to something other than '0'
65 - Type: "always" or Boolean
66
67 If false, never shows colors. If `"always"` then always shows colors. If true, then only prints color codes for tty file descriptors.
68
69 #### `parseable`
70
71 - Default: false
72 - Type: Boolean
73
74 Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format.
75
76 #### `description`
77
78 - Default: true
79 - Type: Boolean
80
81 Show the description in `npm search`
82
83 #### `searchopts`
84
85 - Default: ""
86 - Type: String
87
88 Space-separated options that are always passed to search.
89
90 #### `searchexclude`
91
92 - Default: ""
93 - Type: String
94
95 Space-separated options that limit the results from search.
96
97 #### `registry`
98
99 - Default: "https://registry.npmjs.org/"
100 - Type: URL
101
102 The base URL of the npm registry.
103
104 #### `prefer-online`
105
106 - Default: false
107 - Type: Boolean
108
109 If true, staleness checks for cached data will be forced, making the CLI look for updates immediately even for fresh package data.
110
111 #### `prefer-offline`
112
113 - Default: false
114 - Type: Boolean
115
116 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`.
117
118 #### `offline`
119
120 - Default: false
121 - Type: Boolean
122
123 Force offline mode: no network requests will be done during install. To allow the CLI to fill in missing cache data, see `--prefer-offline`.
124
125 ### See Also
126
127 - [npm registry](/cli/v7/using-npm/registry)
128 - [npm config](/cli/v7/commands/npm-config)
129 - [npmrc](/cli/v7/configuring-npm/npmrc)
130 - [npm view](/cli/v7/commands/npm-view)
131 - [npm cache](/cli/v7/commands/npm-cache)
132 - https://npm.im/npm-registry-fetch