REDROOM
PHP 8.1.33
Path:
Logout
Edit File
Size: 1.52 KB
Close
//lib/node_modules/npm/lib/search/all-package-search.js
Text
Base64
var ms = require('mississippi') var allPackageMetadata = require('./all-package-metadata') var packageFilter = require('./package-filter.js') module.exports = allPackageSearch function allPackageSearch (opts) { var searchSection = (opts.unicode ? '🤔 ' : '') + 'search' // Get a stream with *all* the packages. This takes care of dealing // with the local cache as well, but that's an internal detail. var allEntriesStream = allPackageMetadata(opts) // Grab a stream that filters those packages according to given params. var filterStream = streamFilter(function (pkg) { opts.log.gauge.pulse('search') opts.log.gauge.show({section: searchSection, logline: 'scanning ' + pkg.name}) // Simply 'true' if the package matches search parameters. var match = packageFilter(pkg, opts.include, opts.exclude, { description: opts.description }) return match }) return ms.pipeline.obj(allEntriesStream, filterStream) } function streamFilter (filter) { return ms.through.obj(function (data, enc, cb) { if (filter(data)) { this.push(standardizePkg(data)) } cb() }) } function standardizePkg (data) { return { name: data.name, description: data.description, maintainers: (data.maintainers || []).map(function (m) { return { username: m.name, email: m.email } }), keywords: data.keywords || [], version: Object.keys(data.versions || {})[0] || [], date: ( data.time && data.time.modified && new Date(data.time.modified) ) || null } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
all-package-metadata.js
11.75 KB
lrw-r--r--
2021-03-10 14:36:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
all-package-search.js
1.52 KB
lrw-r--r--
2021-03-10 14:36:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
format-package-stream.js
4.25 KB
lrw-r--r--
2021-03-10 14:36:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package-filter.js
1.18 KB
lrw-r--r--
2021-03-10 14:36:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).