MCPcopy
hub / github.com/serverless/serverless / search

Method search

packages/serverless/lib/plugins/plugin/search.js:27–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25 }
26
27 async search() {
28 const plugins = await this.getPlugins()
29
30 // filter out plugins which match the query
31 const regex = new RegExp(this.options.query)
32
33 const filteredPlugins = plugins.filter(
34 (plugin) => plugin.name.match(regex) || plugin.description.match(regex),
35 )
36
37 // print a message with the search result
38 const pluginCount = filteredPlugins.length
39 const query = this.options.query
40 log.notice(`${pluginCount} plugin(s) found matching "${query}":`)
41 log.notice()
42
43 await this.display(filteredPlugins)
44 }
45}
46
47export default PluginSearch

Callers 5

constructorMethod · 0.95
getFunctionsToInstrumentFunction · 0.80
getIntegratedFunctionsFunction · 0.80
test.jsFile · 0.80

Calls 3

getPluginsMethod · 0.80
displayMethod · 0.80
noticeMethod · 0.45

Tested by

no test coverage detected