From 332830be8ecd1e4ef44b10a7d3ace12b88143b9b Mon Sep 17 00:00:00 2001 From: claudiahdz Date: Thu, 4 Jun 2020 14:36:47 -0500 Subject: [PATCH] chore: refactor npm outdated export --- lib/outdated.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/outdated.js b/lib/outdated.js index dfb3b0cc32ef4..59be3672860aa 100644 --- a/lib/outdated.js +++ b/lib/outdated.js @@ -13,12 +13,14 @@ const Arborist = require('@npmcli/arborist') const npm = require('./npm.js') const output = require('./utils/output.js') +const usageUtil = require('./utils/usage.js') const ansiTrim = require('./utils/ansi-trim.js') -cmd.usage = 'npm outdated [[<@scope>/] ...]' -cmd.completion = require('./utils/completion/installed-deep.js') +const usage = usageUtil('outdated', + 'npm outdated [[<@scope>/] ...]' +) +const completion = (cb) => cb(null, []) -module.exports = cmd function cmd (args, cb) { outdated(args, cb) .then(() => cb()) @@ -267,3 +269,5 @@ function makeJSON (list, opts) { }) return JSON.stringify(out, null, 2) } + +module.exports = Object.assign(cmd, { completion, usage }) \ No newline at end of file