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