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