Lines Matching +full:ls +full:- +full:tree
7 const npa = require('npm-package-arg')
20 const ArboristWorkspaceCmd = require('../arborist-cmd.js')
21 const localeCompare = require('@isaacs/string-locale-compare')('en')
23 class LS extends ArboristWorkspaceCmd { class
25 static name = 'ls'
26 static usage = ['<package-spec>']
37 'package-lock-only',
45 const completion = require('../utils/completion/installed-deep.js')
60 const packageLockOnly = this.npm.config.get('package-lock-only')
73 const tree = await this.initTree({ arb, args, packageLockOnly })
75 // filters by workspaces nodes when using -w <workspace-name>
80 wsNodes = arb.workspaceNodes(tree, this.workspaceNames)
118 // add root node of tree to list of seenNodes
119 seenNodes.set(tree.path, tree)
121 // tree traversal happens here, using treeverse.breadth
123 tree, property
125 // the `tree` obj) that was just visited in the `visit` method below
151 // visit each `node` of the `tree`, returning an `item` - these are
177 const [rootError] = tree.errors.filter(e =>
210 const tree = await (
216 tree[_include] = args.length === 0
217 tree[_depth] = 0
219 return tree
222 module.exports = LS
268 // structure expected by archy in order to print tree
286 // special formatting for top-level package name
335 (node.isLink ? ` -> ${relativePrefix}${targetLocation}` : '') +
353 // overridden anyway, and if we add the flag it causes undesirable behavior when `npm ls --json`
361 // special formatting for top-level package name
428 // keeps track of a set of seen paths to avoid the edge case in which a tree
461 // revisit that node in tree traversal logic, so we make it so that
487 // _parent is going to be a ref to a treeverse-visited node (returned from
489 // shortcut to place new nodes in their right place during tree traversal
492 // e.g: `npm ls foo`, `npm ls simple-output@2`
497 // _depth keeps track of how many levels deep tree traversal currently is
498 // so that we can `npm ls --depth=1`
507 // we need to traverse the entire tree in order to determine which items
538 // we need to traverse the entire tree in order to determine which items
544 // to provide a json object structure that represents the installed tree