11cb0ef41Sopenharmony_ci--- 21cb0ef41Sopenharmony_cititle: npm-search 31cb0ef41Sopenharmony_cisection: 1 41cb0ef41Sopenharmony_cidescription: Search for packages 51cb0ef41Sopenharmony_ci--- 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci### Synopsis 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ci```bash 101cb0ef41Sopenharmony_cinpm search [search terms ...] 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_cialiases: find, s, se 131cb0ef41Sopenharmony_ci``` 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ciNote: This command is unaware of workspaces. 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ci### Description 181cb0ef41Sopenharmony_ci 191cb0ef41Sopenharmony_ciSearch the registry for packages matching the search terms. `npm search` 201cb0ef41Sopenharmony_ciperforms a linear, incremental, lexically-ordered search through package 211cb0ef41Sopenharmony_cimetadata for all files in the registry. If your terminal has color 221cb0ef41Sopenharmony_cisupport, it will further highlight the matches in the results. This can 231cb0ef41Sopenharmony_cibe disabled with the config item `color` 241cb0ef41Sopenharmony_ci 251cb0ef41Sopenharmony_ciAdditionally, using the `--searchopts` and `--searchexclude` options 261cb0ef41Sopenharmony_cipaired with more search terms will include and exclude further patterns. 271cb0ef41Sopenharmony_ciThe main difference between `--searchopts` and the standard search terms 281cb0ef41Sopenharmony_ciis that the former does not highlight results in the output and you can 291cb0ef41Sopenharmony_ciuse them more fine-grained filtering. Additionally, you can add both of 301cb0ef41Sopenharmony_cithese to your config to change default search filtering behavior. 311cb0ef41Sopenharmony_ci 321cb0ef41Sopenharmony_ciSearch also allows targeting of maintainers in search results, by prefixing 331cb0ef41Sopenharmony_citheir npm username with `=`. 341cb0ef41Sopenharmony_ci 351cb0ef41Sopenharmony_ciIf a term starts with `/`, then it's interpreted as a regular expression 361cb0ef41Sopenharmony_ciand supports standard JavaScript RegExp syntax. In this case search will 371cb0ef41Sopenharmony_ciignore a trailing `/` . (Note you must escape or quote many regular 381cb0ef41Sopenharmony_ciexpression characters in most shells.) 391cb0ef41Sopenharmony_ci 401cb0ef41Sopenharmony_ci### Configuration 411cb0ef41Sopenharmony_ci 421cb0ef41Sopenharmony_ci#### `long` 431cb0ef41Sopenharmony_ci 441cb0ef41Sopenharmony_ci* Default: false 451cb0ef41Sopenharmony_ci* Type: Boolean 461cb0ef41Sopenharmony_ci 471cb0ef41Sopenharmony_ciShow extended information in `ls`, `search`, and `help-search`. 481cb0ef41Sopenharmony_ci 491cb0ef41Sopenharmony_ci 501cb0ef41Sopenharmony_ci 511cb0ef41Sopenharmony_ci#### `json` 521cb0ef41Sopenharmony_ci 531cb0ef41Sopenharmony_ci* Default: false 541cb0ef41Sopenharmony_ci* Type: Boolean 551cb0ef41Sopenharmony_ci 561cb0ef41Sopenharmony_ciWhether or not to output JSON data, rather than the normal output. 571cb0ef41Sopenharmony_ci 581cb0ef41Sopenharmony_ci* In `npm pkg set` it enables parsing set values with JSON.parse() before 591cb0ef41Sopenharmony_ci saving them to your `package.json`. 601cb0ef41Sopenharmony_ci 611cb0ef41Sopenharmony_ciNot supported by all npm commands. 621cb0ef41Sopenharmony_ci 631cb0ef41Sopenharmony_ci 641cb0ef41Sopenharmony_ci 651cb0ef41Sopenharmony_ci#### `color` 661cb0ef41Sopenharmony_ci 671cb0ef41Sopenharmony_ci* Default: true unless the NO_COLOR environ is set to something other than '0' 681cb0ef41Sopenharmony_ci* Type: "always" or Boolean 691cb0ef41Sopenharmony_ci 701cb0ef41Sopenharmony_ciIf false, never shows colors. If `"always"` then always shows colors. If 711cb0ef41Sopenharmony_citrue, then only prints color codes for tty file descriptors. 721cb0ef41Sopenharmony_ci 731cb0ef41Sopenharmony_ci 741cb0ef41Sopenharmony_ci 751cb0ef41Sopenharmony_ci#### `parseable` 761cb0ef41Sopenharmony_ci 771cb0ef41Sopenharmony_ci* Default: false 781cb0ef41Sopenharmony_ci* Type: Boolean 791cb0ef41Sopenharmony_ci 801cb0ef41Sopenharmony_ciOutput parseable results from commands that write to standard output. For 811cb0ef41Sopenharmony_ci`npm search`, this will be tab-separated table format. 821cb0ef41Sopenharmony_ci 831cb0ef41Sopenharmony_ci 841cb0ef41Sopenharmony_ci 851cb0ef41Sopenharmony_ci#### `description` 861cb0ef41Sopenharmony_ci 871cb0ef41Sopenharmony_ci* Default: true 881cb0ef41Sopenharmony_ci* Type: Boolean 891cb0ef41Sopenharmony_ci 901cb0ef41Sopenharmony_ciShow the description in `npm search` 911cb0ef41Sopenharmony_ci 921cb0ef41Sopenharmony_ci 931cb0ef41Sopenharmony_ci 941cb0ef41Sopenharmony_ci#### `searchopts` 951cb0ef41Sopenharmony_ci 961cb0ef41Sopenharmony_ci* Default: "" 971cb0ef41Sopenharmony_ci* Type: String 981cb0ef41Sopenharmony_ci 991cb0ef41Sopenharmony_ciSpace-separated options that are always passed to search. 1001cb0ef41Sopenharmony_ci 1011cb0ef41Sopenharmony_ci 1021cb0ef41Sopenharmony_ci 1031cb0ef41Sopenharmony_ci#### `searchexclude` 1041cb0ef41Sopenharmony_ci 1051cb0ef41Sopenharmony_ci* Default: "" 1061cb0ef41Sopenharmony_ci* Type: String 1071cb0ef41Sopenharmony_ci 1081cb0ef41Sopenharmony_ciSpace-separated options that limit the results from search. 1091cb0ef41Sopenharmony_ci 1101cb0ef41Sopenharmony_ci 1111cb0ef41Sopenharmony_ci 1121cb0ef41Sopenharmony_ci#### `registry` 1131cb0ef41Sopenharmony_ci 1141cb0ef41Sopenharmony_ci* Default: "https://registry.npmjs.org/" 1151cb0ef41Sopenharmony_ci* Type: URL 1161cb0ef41Sopenharmony_ci 1171cb0ef41Sopenharmony_ciThe base URL of the npm registry. 1181cb0ef41Sopenharmony_ci 1191cb0ef41Sopenharmony_ci 1201cb0ef41Sopenharmony_ci 1211cb0ef41Sopenharmony_ci#### `prefer-online` 1221cb0ef41Sopenharmony_ci 1231cb0ef41Sopenharmony_ci* Default: false 1241cb0ef41Sopenharmony_ci* Type: Boolean 1251cb0ef41Sopenharmony_ci 1261cb0ef41Sopenharmony_ciIf true, staleness checks for cached data will be forced, making the CLI 1271cb0ef41Sopenharmony_cilook for updates immediately even for fresh package data. 1281cb0ef41Sopenharmony_ci 1291cb0ef41Sopenharmony_ci 1301cb0ef41Sopenharmony_ci 1311cb0ef41Sopenharmony_ci#### `prefer-offline` 1321cb0ef41Sopenharmony_ci 1331cb0ef41Sopenharmony_ci* Default: false 1341cb0ef41Sopenharmony_ci* Type: Boolean 1351cb0ef41Sopenharmony_ci 1361cb0ef41Sopenharmony_ciIf true, staleness checks for cached data will be bypassed, but missing data 1371cb0ef41Sopenharmony_ciwill be requested from the server. To force full offline mode, use 1381cb0ef41Sopenharmony_ci`--offline`. 1391cb0ef41Sopenharmony_ci 1401cb0ef41Sopenharmony_ci 1411cb0ef41Sopenharmony_ci 1421cb0ef41Sopenharmony_ci#### `offline` 1431cb0ef41Sopenharmony_ci 1441cb0ef41Sopenharmony_ci* Default: false 1451cb0ef41Sopenharmony_ci* Type: Boolean 1461cb0ef41Sopenharmony_ci 1471cb0ef41Sopenharmony_ciForce offline mode: no network requests will be done during install. To 1481cb0ef41Sopenharmony_ciallow the CLI to fill in missing cache data, see `--prefer-offline`. 1491cb0ef41Sopenharmony_ci 1501cb0ef41Sopenharmony_ci 1511cb0ef41Sopenharmony_ci 1521cb0ef41Sopenharmony_ci### See Also 1531cb0ef41Sopenharmony_ci 1541cb0ef41Sopenharmony_ci* [npm registry](/using-npm/registry) 1551cb0ef41Sopenharmony_ci* [npm config](/commands/npm-config) 1561cb0ef41Sopenharmony_ci* [npmrc](/configuring-npm/npmrc) 1571cb0ef41Sopenharmony_ci* [npm view](/commands/npm-view) 1581cb0ef41Sopenharmony_ci* [npm cache](/commands/npm-cache) 1591cb0ef41Sopenharmony_ci* https://npm.im/npm-registry-fetch 160