Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/ls.js
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2021-03-04 07:26:33 +0300
committerGar <gar+gh@danger.computer>2021-03-09 22:10:06 +0300
commit9fe0df5b5d7606e5841288d9931be6c04767c9ca (patch)
tree50b916523fe4a5ebab6010b137cc931cc2a9ce70 /lib/ls.js
parent85a8694dd9b4a924a474ba75261914511a216868 (diff)
fix(usage): clean up usage declarations
Small refactor of commands to allow usage to be more programmatically generated, leading us in the direction of more tighly coupling each command to the params it accepts. PR-URL: https://github.com/npm/cli/pull/2821 Credit: @wraithgar Close: #2821 Reviewed-by: @isaacs
Diffstat (limited to 'lib/ls.js')
-rw-r--r--lib/ls.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/ls.js b/lib/ls.js
index b94684401..9ff2761c2 100644
--- a/lib/ls.js
+++ b/lib/ls.js
@@ -7,7 +7,6 @@ const Arborist = require('@npmcli/arborist')
const { breadth } = require('treeverse')
const npa = require('npm-package-arg')
-const usageUtil = require('./utils/usage.js')
const completion = require('./utils/completion/installed-deep.js')
const _depth = Symbol('depth')
@@ -21,18 +20,17 @@ const _parent = Symbol('parent')
const _problems = Symbol('problems')
const _required = Symbol('required')
const _type = Symbol('type')
+const BaseCommand = require('./base-command.js')
-class LS {
- constructor (npm) {
- this.npm = npm
+class LS extends BaseCommand {
+ /* istanbul ignore next - see test/lib/load-all-commands.js */
+ static get name () {
+ return 'ls'
}
/* istanbul ignore next - see test/lib/load-all-commands.js */
- get usage () {
- return usageUtil(
- 'ls',
- 'npm ls [[<@scope>/]<pkg> ...]'
- )
+ static get usage () {
+ return ['npm ls [[<@scope>/]<pkg> ...]']
}
/* istanbul ignore next - see test/lib/load-all-commands.js */