PATH:
usr
/
lib
/
node_modules
/
npm
/
lib
/
commands
const fetch = require('npm-registry-fetch') const log = require('../utils/log-shim') const getIdentity = require('../utils/get-identity.js') const BaseCommand = require('../base-command.js') class Stars extends BaseCommand { static description = 'View packages marked as favorites' static name = 'stars' static usage = ['[<user>]'] static params = ['registry'] static ignoreImplicitWorkspace = false async exec ([user]) { try { if (!user) { user = await getIdentity(this.npm, this.npm.flatOptions) } const { rows } = await fetch.json('/-/_view/starredByUser', { ...this.npm.flatOptions, query: { key: `"${user}"` }, }) if (rows.length === 0) { log.warn('stars', 'user has not starred any packages') } for (const row of rows) { this.npm.output(row.value) } } catch (err) { if (err.code === 'ENEEDAUTH') { log.warn('stars', 'auth is required to look up your username') } throw err } } } module.exports = Stars
[-] star.js
[edit]
[-] ping.js
[edit]
[-] stop.js
[edit]
[-] team.js
[edit]
[-] run-script.js
[edit]
[-] edit.js
[edit]
[-] explore.js
[edit]
[-] access.js
[edit]
[-] explain.js
[edit]
[-] repo.js
[edit]
[-] root.js
[edit]
[-] completion.js
[edit]
[-] bugs.js
[edit]
[-] restart.js
[edit]
[+]
..
[-] pack.js
[edit]
[-] ll.js
[edit]
[-] install-test.js
[edit]
[-] find-dupes.js
[edit]
[-] unstar.js
[edit]
[-] org.js
[edit]
[-] dedupe.js
[edit]
[-] birthday.js
[edit]
[-] test.js
[edit]
[-] audit.js
[edit]
[-] install-ci-test.js
[edit]
[-] cache.js
[edit]
[-] outdated.js
[edit]
[-] link.js
[edit]
[-] diff.js
[edit]
[-] logout.js
[edit]
[-] install.js
[edit]
[-] fund.js
[edit]
[-] ci.js
[edit]
[-] get.js
[edit]
[-] profile.js
[edit]
[-] uninstall.js
[edit]
[-] init.js
[edit]
[-] prune.js
[edit]
[-] dist-tag.js
[edit]
[-] search.js
[edit]
[-] view.js
[edit]
[-] owner.js
[edit]
[-] rebuild.js
[edit]
[-] query.js
[edit]
[-] start.js
[edit]
[-] config.js
[edit]
[-] update.js
[edit]
[-] docs.js
[edit]
[-] help.js
[edit]
[-] ls.js
[edit]
[-] deprecate.js
[edit]
[-] exec.js
[edit]
[-] hook.js
[edit]
[-] publish.js
[edit]
[-] prefix.js
[edit]
[-] adduser.js
[edit]
[-] shrinkwrap.js
[edit]
[-] help-search.js
[edit]
[-] stars.js
[edit]
[-] doctor.js
[edit]
[-] set.js
[edit]
[-] whoami.js
[edit]
[-] version.js
[edit]
[-] pkg.js
[edit]
[-] bin.js
[edit]
[-] token.js
[edit]
[-] set-script.js
[edit]
[-] unpublish.js
[edit]