From 716a07fde7905bb69e4c6f1991bb7289589a6669 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 24 Mar 2022 13:23:02 -0700 Subject: [PATCH] fix: 100% coverage in tests (#4607) * fix: 100% coverage in tests * Removed dead code in `lib/utils/usage.js`. * Removed dead code in `lib/base-command.js`. * Removed "load-all" test, we currently have 100% coverage and new PRs without tests will be rejected if they don't add coverage for new files. * Removed `check-coverage` script as a separate command. * Removed separate coverage test in ci.yml. * Removed `coverage` flag from tap config, the default is already to enforce 100% coverage. Removed a tiny bit of dead code resulting from this * fix: clean up usage output Removed usage lib, rolled logic into base-command.js Cleaned up usage output to be less redundant --- .github/workflows/ci.yml | 20 +- lib/base-command.js | 48 ++-- lib/utils/usage.js | 32 --- package.json | 2 - scripts/config-doc-command.js | 18 +- .../test/lib/load-all-commands.js.test.cjs | 132 --------- .../test/lib/utils/npm-usage.js.test.cjs | 264 +++++------------- test/coverage-map.js | 27 +- test/lib/commands/access.js | 16 +- test/lib/commands/cache.js | 2 +- test/lib/commands/diff.js | 1 - test/lib/commands/init.js | 1 - test/lib/commands/owner.js | 1 - test/lib/commands/profile.js | 1 - test/lib/commands/search.js | 1 - test/lib/commands/star.js | 5 +- test/lib/commands/stars.js | 1 - test/lib/commands/team.js | 1 - test/lib/commands/unpublish.js | 8 +- test/lib/commands/update.js | 1 - test/lib/load-all.js | 31 -- 21 files changed, 145 insertions(+), 468 deletions(-) delete mode 100644 lib/utils/usage.js delete mode 100644 test/lib/load-all.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6b9125938e1e..5ebc711aefe9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,22 +145,6 @@ jobs: node ./bin/npm-cli.js install --ignore-scripts --no-audit node ./bin/npm-cli.js rebuild - # Run the tests, but not if we're just gonna do coveralls later anyway + # Run the tests - name: Run Tap tests - if: matrix.platform.os != 'ubuntu-latest' || matrix.node-version != '16.x' - run: node ./bin/npm-cli.js run --ignore-scripts test -- -t600 -Rbase -c - env: - DEPLOY_VERSION: testing - - # Run coverage check - - name: Run coverage report - if: matrix.platform.os == 'ubuntu-latest' && matrix.node-version == '16.x' - # turn off --check-coverage until 100%, so CI failure is relevant - run: node ./bin/npm-cli.js run check-coverage -- -t600 --no-check-coverage -Rbase -c - env: - DEPLOY_VERSION: testing - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_OPTIONAL_TOKEN }} - - # - name: Run sudo tests on Linux - # if: matrix.os == 'ubuntu-latest' - # run: sudo PATH=$PATH $(which node) . test -- --coverage --timeout 600 + run: node ./bin/npm-cli.js run test --ignore-scripts -- -t600 -Rbase -c diff --git a/lib/base-command.js b/lib/base-command.js index b6e3d6d231860..3ab800adbfd98 100644 --- a/lib/base-command.js +++ b/lib/base-command.js @@ -2,10 +2,11 @@ const { relative } = require('path') -const usageUtil = require('./utils/usage.js') const ConfigDefinitions = require('./utils/config/definitions.js') const getWorkspaces = require('./workspaces/get-workspaces.js') +const cmdAliases = require('./utils/cmd-list').aliases + class BaseCommand { constructor (npm) { this.wrapWidth = 80 @@ -25,28 +26,43 @@ class BaseCommand { } get usage () { - let usage = `npm ${this.constructor.name}\n\n` - if (this.constructor.description) { - usage = `${usage}${this.constructor.description}\n\n` - } + const usage = [ + `${this.constructor.description}`, + '', + 'Usage:', + ] - usage = `${usage}Usage:\n` if (!this.constructor.usage) { - usage = `${usage}npm ${this.constructor.name}` + usage.push(`npm ${this.constructor.name}`) } else { - usage = `${usage}${this.constructor.usage - .map(u => `npm ${this.constructor.name} ${u}`) - .join('\n')}` + usage.push(...this.constructor.usage.map(u => `npm ${this.constructor.name} ${u}`)) } if (this.constructor.params) { - usage = `${usage}\n\nOptions:\n${this.wrappedParams}` + usage.push('') + usage.push('Options:') + usage.push(this.wrappedParams) + } + + const aliases = Object.keys(cmdAliases).reduce((p, c) => { + if (cmdAliases[c] === this.constructor.name) { + p.push(c) + } + return p + }, []) + + if (aliases.length === 1) { + usage.push('') + usage.push(`alias: ${aliases.join(', ')}`) + } else if (aliases.length > 1) { + usage.push('') + usage.push(`aliases: ${aliases.join(', ')}`) } - // Mostly this just appends aliases, this could be more clear - usage = usageUtil(this.constructor.name, usage) - usage = `${usage}\n\nRun "npm help ${this.constructor.name}" for more info` - return usage + usage.push('') + usage.push(`Run "npm help ${this.constructor.name}" for more info`) + + return usage.join('\n') } get wrappedParams () { @@ -69,7 +85,7 @@ class BaseCommand { if (prefix) { prefix += '\n\n' } - return Object.assign(new Error(`\nUsage: ${prefix}${this.usage}`), { + return Object.assign(new Error(`\n${prefix}${this.usage}`), { code: 'EUSAGE', }) } diff --git a/lib/utils/usage.js b/lib/utils/usage.js deleted file mode 100644 index 39eaa45e4101e..0000000000000 --- a/lib/utils/usage.js +++ /dev/null @@ -1,32 +0,0 @@ -const aliases = require('./cmd-list').aliases - -module.exports = function usage (cmd, txt, opt) { - const post = Object.keys(aliases).reduce(function (p, c) { - var val = aliases[c] - if (val !== cmd) { - return p - } - return p.concat(c) - }, []) - - if (opt || post.length > 0) { - txt += '\n\n' - } - - if (post.length === 1) { - txt += 'alias: ' - txt += post.join(', ') - } else if (post.length > 1) { - txt += 'aliases: ' - txt += post.join(', ') - } - - if (opt) { - if (post.length > 0) { - txt += '\n' - } - txt += 'common options: ' + opt - } - - return txt -} diff --git a/package.json b/package.json index ac5f5dd0bc9b0..05cf493d78786 100644 --- a/package.json +++ b/package.json @@ -216,7 +216,6 @@ "licenses": "licensee --production --errors-only", "test": "tap", "test-all": "npm run test --if-present --workspaces --include-workspace-root", - "check-coverage": "tap", "snap": "tap", "postsnap": "make -s mandocs", "test:nocleanup": "NO_TEST_CLEANUP=1 npm run test --", @@ -237,7 +236,6 @@ "color": 1, "files": "test/{lib,bin,index.js}", "coverage-map": "test/coverage-map.js", - "check-coverage": true, "timeout": 600 }, "templateOSS": { diff --git a/scripts/config-doc-command.js b/scripts/config-doc-command.js index af008b7e1991c..efc8315619e8a 100644 --- a/scripts/config-doc-command.js +++ b/scripts/config-doc-command.js @@ -1,5 +1,5 @@ const { definitions } = require('../lib/utils/config/index.js') -const usageFn = require('../lib/utils/usage.js') +const cmdAliases = require('../lib/utils/cmd-list').aliases const { writeFileSync, readFileSync } = require('fs') const { resolve } = require('path') @@ -52,9 +52,19 @@ const describeUsage = ({ usage }) => { synopsis.push(usage.map(usageInfo => `${baseCommand} ${usageInfo}`).join('\n')) } - const aliases = usageFn(commandName, '').trim() - if (aliases) { - synopsis.push(`\n${aliases}`) + const aliases = Object.keys(cmdAliases).reduce((p, c) => { + if (cmdAliases[c] === commandName) { + p.push(c) + } + return p + }, []) + + if (aliases.length === 1) { + synopsis.push('') + synopsis.push(`alias: ${aliases[0]}`) + } else if (aliases.length > 1) { + synopsis.push('') + synopsis.push(`aliases: ${aliases.join(', ')}`) } } } else { diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs index 9fe2a5491c013..66c48983a0ea3 100644 --- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs +++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs @@ -6,8 +6,6 @@ */ 'use strict' exports[`test/lib/load-all-commands.js TAP load each command access > must match snapshot 1`] = ` -npm access - Set access level on published packages Usage: @@ -28,8 +26,6 @@ Run "npm help access" for more info ` exports[`test/lib/load-all-commands.js TAP load each command adduser > must match snapshot 1`] = ` -npm adduser - Add a registry user account Usage: @@ -44,8 +40,6 @@ Run "npm help adduser" for more info ` exports[`test/lib/load-all-commands.js TAP load each command audit > must match snapshot 1`] = ` -npm audit - Run a security audit Usage: @@ -63,8 +57,6 @@ Run "npm help audit" for more info ` exports[`test/lib/load-all-commands.js TAP load each command bin > must match snapshot 1`] = ` -npm bin - Display npm bin folder Usage: @@ -77,8 +69,6 @@ Run "npm help bin" for more info ` exports[`test/lib/load-all-commands.js TAP load each command bugs > must match snapshot 1`] = ` -npm bugs - Report bugs for a package in a web browser Usage: @@ -93,8 +83,6 @@ Run "npm help bugs" for more info ` exports[`test/lib/load-all-commands.js TAP load each command cache > must match snapshot 1`] = ` -npm cache - Manipulates packages cache Usage: @@ -114,8 +102,6 @@ Run "npm help cache" for more info ` exports[`test/lib/load-all-commands.js TAP load each command ci > must match snapshot 1`] = ` -npm ci - Install a project with a clean slate Usage: @@ -131,8 +117,6 @@ Run "npm help ci" for more info ` exports[`test/lib/load-all-commands.js TAP load each command completion > must match snapshot 1`] = ` -npm completion - Tab Completion for npm Usage: @@ -142,8 +126,6 @@ Run "npm help completion" for more info ` exports[`test/lib/load-all-commands.js TAP load each command config > must match snapshot 1`] = ` -npm config - Manage the npm configuration files Usage: @@ -163,8 +145,6 @@ Run "npm help config" for more info ` exports[`test/lib/load-all-commands.js TAP load each command dedupe > must match snapshot 1`] = ` -npm dedupe - Reduce duplication in the package tree Usage: @@ -184,8 +164,6 @@ Run "npm help dedupe" for more info ` exports[`test/lib/load-all-commands.js TAP load each command deprecate > must match snapshot 1`] = ` -npm deprecate - Deprecate a version of a package Usage: @@ -198,8 +176,6 @@ Run "npm help deprecate" for more info ` exports[`test/lib/load-all-commands.js TAP load each command diff > must match snapshot 1`] = ` -npm diff - The registry diff command Usage: @@ -217,8 +193,6 @@ Run "npm help diff" for more info ` exports[`test/lib/load-all-commands.js TAP load each command dist-tag > must match snapshot 1`] = ` -npm dist-tag - Modify package distribution tags Usage: @@ -236,8 +210,6 @@ Run "npm help dist-tag" for more info ` exports[`test/lib/load-all-commands.js TAP load each command docs > must match snapshot 1`] = ` -npm docs - Open documentation for a package in a web browser Usage: @@ -254,8 +226,6 @@ Run "npm help docs" for more info ` exports[`test/lib/load-all-commands.js TAP load each command doctor > must match snapshot 1`] = ` -npm doctor - Check your npm environment Usage: @@ -268,8 +238,6 @@ Run "npm help doctor" for more info ` exports[`test/lib/load-all-commands.js TAP load each command edit > must match snapshot 1`] = ` -npm edit - Edit an installed package Usage: @@ -282,8 +250,6 @@ Run "npm help edit" for more info ` exports[`test/lib/load-all-commands.js TAP load each command exec > must match snapshot 1`] = ` -npm exec - Run a command from a local or remote npm package Usage: @@ -304,8 +270,6 @@ Run "npm help exec" for more info ` exports[`test/lib/load-all-commands.js TAP load each command explain > must match snapshot 1`] = ` -npm explain - Explain installed packages Usage: @@ -320,8 +284,6 @@ Run "npm help explain" for more info ` exports[`test/lib/load-all-commands.js TAP load each command explore > must match snapshot 1`] = ` -npm explore - Browse an installed package Usage: @@ -334,8 +296,6 @@ Run "npm help explore" for more info ` exports[`test/lib/load-all-commands.js TAP load each command find-dupes > must match snapshot 1`] = ` -npm find-dupes - Find duplication in the package tree Usage: @@ -352,8 +312,6 @@ Run "npm help find-dupes" for more info ` exports[`test/lib/load-all-commands.js TAP load each command fund > must match snapshot 1`] = ` -npm fund - Retrieve funding information Usage: @@ -368,8 +326,6 @@ Run "npm help fund" for more info ` exports[`test/lib/load-all-commands.js TAP load each command get > must match snapshot 1`] = ` -npm get - Get a value from the npm configuration Usage: @@ -379,8 +335,6 @@ Run "npm help get" for more info ` exports[`test/lib/load-all-commands.js TAP load each command help > must match snapshot 1`] = ` -npm help - Get help on npm Usage: @@ -395,8 +349,6 @@ Run "npm help help" for more info ` exports[`test/lib/load-all-commands.js TAP load each command hook > must match snapshot 1`] = ` -npm hook - Manage registry hooks Usage: @@ -412,8 +364,6 @@ Run "npm help hook" for more info ` exports[`test/lib/load-all-commands.js TAP load each command init > must match snapshot 1`] = ` -npm init - Create a package.json file Usage: @@ -432,8 +382,6 @@ Run "npm help init" for more info ` exports[`test/lib/load-all-commands.js TAP load each command install > must match snapshot 1`] = ` -npm install - Install a package Usage: @@ -463,8 +411,6 @@ Run "npm help install" for more info ` exports[`test/lib/load-all-commands.js TAP load each command install-ci-test > must match snapshot 1`] = ` -npm install-ci-test - Install a project with a clean slate and run tests Usage: @@ -480,8 +426,6 @@ Run "npm help install-ci-test" for more info ` exports[`test/lib/load-all-commands.js TAP load each command install-test > must match snapshot 1`] = ` -npm install-test - Install package(s) and run tests Usage: @@ -511,8 +455,6 @@ Run "npm help install-test" for more info ` exports[`test/lib/load-all-commands.js TAP load each command link > must match snapshot 1`] = ` -npm link - Symlink a package folder Usage: @@ -534,8 +476,6 @@ Run "npm help link" for more info ` exports[`test/lib/load-all-commands.js TAP load each command ll > must match snapshot 1`] = ` -npm ll - List installed packages Usage: @@ -554,8 +494,6 @@ Run "npm help ll" for more info ` exports[`test/lib/load-all-commands.js TAP load each command login > must match snapshot 1`] = ` -npm adduser - Add a registry user account Usage: @@ -570,8 +508,6 @@ Run "npm help adduser" for more info ` exports[`test/lib/load-all-commands.js TAP load each command logout > must match snapshot 1`] = ` -npm logout - Log out of the registry Usage: @@ -584,8 +520,6 @@ Run "npm help logout" for more info ` exports[`test/lib/load-all-commands.js TAP load each command ls > must match snapshot 1`] = ` -npm ls - List installed packages Usage: @@ -604,8 +538,6 @@ Run "npm help ls" for more info ` exports[`test/lib/load-all-commands.js TAP load each command org > must match snapshot 1`] = ` -npm org - Manage orgs Usage: @@ -622,8 +554,6 @@ Run "npm help org" for more info ` exports[`test/lib/load-all-commands.js TAP load each command outdated > must match snapshot 1`] = ` -npm outdated - Check for outdated packages Usage: @@ -637,8 +567,6 @@ Run "npm help outdated" for more info ` exports[`test/lib/load-all-commands.js TAP load each command owner > must match snapshot 1`] = ` -npm owner - Manage package owners Usage: @@ -655,8 +583,6 @@ Run "npm help owner" for more info ` exports[`test/lib/load-all-commands.js TAP load each command pack > must match snapshot 1`] = ` -npm pack - Create a tarball from a package Usage: @@ -671,8 +597,6 @@ Run "npm help pack" for more info ` exports[`test/lib/load-all-commands.js TAP load each command ping > must match snapshot 1`] = ` -npm ping - Ping npm registry Usage: @@ -685,8 +609,6 @@ Run "npm help ping" for more info ` exports[`test/lib/load-all-commands.js TAP load each command pkg > must match snapshot 1`] = ` -npm pkg - Manages your package.json Usage: @@ -705,8 +627,6 @@ Run "npm help pkg" for more info ` exports[`test/lib/load-all-commands.js TAP load each command prefix > must match snapshot 1`] = ` -npm prefix - Display prefix Usage: @@ -719,8 +639,6 @@ Run "npm help prefix" for more info ` exports[`test/lib/load-all-commands.js TAP load each command profile > must match snapshot 1`] = ` -npm profile - Change settings on your registry profile Usage: @@ -736,8 +654,6 @@ Run "npm help profile" for more info ` exports[`test/lib/load-all-commands.js TAP load each command prune > must match snapshot 1`] = ` -npm prune - Remove extraneous packages Usage: @@ -753,8 +669,6 @@ Run "npm help prune" for more info ` exports[`test/lib/load-all-commands.js TAP load each command publish > must match snapshot 1`] = ` -npm publish - Publish a package Usage: @@ -769,8 +683,6 @@ Run "npm help publish" for more info ` exports[`test/lib/load-all-commands.js TAP load each command rebuild > must match snapshot 1`] = ` -npm rebuild - Rebuild a package Usage: @@ -787,8 +699,6 @@ Run "npm help rebuild" for more info ` exports[`test/lib/load-all-commands.js TAP load each command repo > must match snapshot 1`] = ` -npm repo - Open package repository page in the browser Usage: @@ -803,8 +713,6 @@ Run "npm help repo" for more info ` exports[`test/lib/load-all-commands.js TAP load each command restart > must match snapshot 1`] = ` -npm restart - Restart a package Usage: @@ -817,8 +725,6 @@ Run "npm help restart" for more info ` exports[`test/lib/load-all-commands.js TAP load each command root > must match snapshot 1`] = ` -npm root - Display npm root Usage: @@ -831,8 +737,6 @@ Run "npm help root" for more info ` exports[`test/lib/load-all-commands.js TAP load each command run-script > must match snapshot 1`] = ` -npm run-script - Run arbitrary package scripts Usage: @@ -849,8 +753,6 @@ Run "npm help run-script" for more info ` exports[`test/lib/load-all-commands.js TAP load each command search > must match snapshot 1`] = ` -npm search - Search for packages Usage: @@ -867,8 +769,6 @@ Run "npm help search" for more info ` exports[`test/lib/load-all-commands.js TAP load each command set > must match snapshot 1`] = ` -npm set - Set a value in the npm configuration Usage: @@ -878,8 +778,6 @@ Run "npm help set" for more info ` exports[`test/lib/load-all-commands.js TAP load each command set-script > must match snapshot 1`] = ` -npm set-script - Set tasks in the scripts section of package.json Usage: @@ -893,8 +791,6 @@ Run "npm help set-script" for more info ` exports[`test/lib/load-all-commands.js TAP load each command shrinkwrap > must match snapshot 1`] = ` -npm shrinkwrap - Lock down dependency versions for publication Usage: @@ -904,8 +800,6 @@ Run "npm help shrinkwrap" for more info ` exports[`test/lib/load-all-commands.js TAP load each command star > must match snapshot 1`] = ` -npm star - Mark your favorite packages Usage: @@ -918,8 +812,6 @@ Run "npm help star" for more info ` exports[`test/lib/load-all-commands.js TAP load each command stars > must match snapshot 1`] = ` -npm stars - View packages marked as favorites Usage: @@ -932,8 +824,6 @@ Run "npm help stars" for more info ` exports[`test/lib/load-all-commands.js TAP load each command start > must match snapshot 1`] = ` -npm start - Start a package Usage: @@ -946,8 +836,6 @@ Run "npm help start" for more info ` exports[`test/lib/load-all-commands.js TAP load each command stop > must match snapshot 1`] = ` -npm stop - Stop a package Usage: @@ -960,8 +848,6 @@ Run "npm help stop" for more info ` exports[`test/lib/load-all-commands.js TAP load each command team > must match snapshot 1`] = ` -npm team - Manage organization teams and team memberships Usage: @@ -978,8 +864,6 @@ Run "npm help team" for more info ` exports[`test/lib/load-all-commands.js TAP load each command test > must match snapshot 1`] = ` -npm test - Test a package Usage: @@ -994,8 +878,6 @@ Run "npm help test" for more info ` exports[`test/lib/load-all-commands.js TAP load each command token > must match snapshot 1`] = ` -npm token - Manage your authentication tokens Usage: @@ -1011,8 +893,6 @@ Run "npm help token" for more info ` exports[`test/lib/load-all-commands.js TAP load each command uninstall > must match snapshot 1`] = ` -npm uninstall - Remove a package Usage: @@ -1029,8 +909,6 @@ Run "npm help uninstall" for more info ` exports[`test/lib/load-all-commands.js TAP load each command unpublish > must match snapshot 1`] = ` -npm unpublish - Remove a package from the registry Usage: @@ -1045,8 +923,6 @@ Run "npm help unpublish" for more info ` exports[`test/lib/load-all-commands.js TAP load each command unstar > must match snapshot 1`] = ` -npm unstar - Remove an item from your favorite packages Usage: @@ -1059,8 +935,6 @@ Run "npm help unstar" for more info ` exports[`test/lib/load-all-commands.js TAP load each command update > must match snapshot 1`] = ` -npm update - Update packages Usage: @@ -1081,8 +955,6 @@ Run "npm help update" for more info ` exports[`test/lib/load-all-commands.js TAP load each command version > must match snapshot 1`] = ` -npm version - Bump a package version Usage: @@ -1100,8 +972,6 @@ Run "npm help version" for more info ` exports[`test/lib/load-all-commands.js TAP load each command view > must match snapshot 1`] = ` -npm view - View registry info Usage: @@ -1117,8 +987,6 @@ Run "npm help view" for more info ` exports[`test/lib/load-all-commands.js TAP load each command whoami > must match snapshot 1`] = ` -npm whoami - Display npm username Usage: diff --git a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs index 181e47da7d724..1f4b0292c0ec6 100644 --- a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs +++ b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs @@ -165,9 +165,7 @@ npm help npm more involved overview All commands: - access npm access - - Set access level on published packages + access Set access level on published packages Usage: npm access public [] @@ -185,9 +183,7 @@ All commands: Run "npm help access" for more info - adduser npm adduser - - Add a registry user account + adduser Add a registry user account Usage: npm adduser @@ -199,9 +195,7 @@ All commands: Run "npm help adduser" for more info - audit npm audit - - Run a security audit + audit Run a security audit Usage: npm audit [fix] @@ -216,9 +210,7 @@ All commands: Run "npm help audit" for more info - bin npm bin - - Display npm bin folder + bin Display npm bin folder Usage: npm bin @@ -228,9 +220,7 @@ All commands: Run "npm help bin" for more info - bugs npm bugs - - Report bugs for a package in a web browser + bugs Report bugs for a package in a web browser Usage: npm bugs [] @@ -242,9 +232,7 @@ All commands: Run "npm help bugs" for more info - cache npm cache - - Manipulates packages cache + cache Manipulates packages cache Usage: npm cache add @@ -261,9 +249,7 @@ All commands: Run "npm help cache" for more info - ci npm ci - - Install a project with a clean slate + ci Install a project with a clean slate Usage: npm ci @@ -276,18 +262,14 @@ All commands: Run "npm help ci" for more info - completion npm completion - - Tab Completion for npm + completion Tab Completion for npm Usage: npm completion Run "npm help completion" for more info - config npm config - - Manage the npm configuration files + config Manage the npm configuration files Usage: npm config set = [= ...] @@ -304,9 +286,7 @@ All commands: Run "npm help config" for more info - dedupe npm dedupe - - Reduce duplication in the package tree + dedupe Reduce duplication in the package tree Usage: npm dedupe @@ -323,9 +303,7 @@ All commands: Run "npm help dedupe" for more info - deprecate npm deprecate - - Deprecate a version of a package + deprecate Deprecate a version of a package Usage: npm deprecate [@] @@ -335,9 +313,7 @@ All commands: Run "npm help deprecate" for more info - diff npm diff - - The registry diff command + diff The registry diff command Usage: npm diff [...] @@ -352,9 +328,7 @@ All commands: Run "npm help diff" for more info - dist-tag npm dist-tag - - Modify package distribution tags + dist-tag Modify package distribution tags Usage: npm dist-tag add @ [] @@ -369,9 +343,7 @@ All commands: Run "npm help dist-tag" for more info - docs npm docs - - Open documentation for a package in a web browser + docs Open documentation for a package in a web browser Usage: npm docs [ [ ...]] @@ -385,9 +357,7 @@ All commands: Run "npm help docs" for more info - doctor npm doctor - - Check your npm environment + doctor Check your npm environment Usage: npm doctor @@ -397,9 +367,7 @@ All commands: Run "npm help doctor" for more info - edit npm edit - - Edit an installed package + edit Edit an installed package Usage: npm edit [/...] @@ -409,9 +377,7 @@ All commands: Run "npm help edit" for more info - exec npm exec - - Run a command from a local or remote npm package + exec Run a command from a local or remote npm package Usage: npm exec -- [@] [args...] @@ -429,9 +395,7 @@ All commands: Run "npm help exec" for more info - explain npm explain - - Explain installed packages + explain Explain installed packages Usage: npm explain @@ -443,9 +407,7 @@ All commands: Run "npm help explain" for more info - explore npm explore - - Browse an installed package + explore Browse an installed package Usage: npm explore [ -- ] @@ -455,9 +417,7 @@ All commands: Run "npm help explore" for more info - find-dupes npm find-dupes - - Find duplication in the package tree + find-dupes Find duplication in the package tree Usage: npm find-dupes @@ -471,9 +431,7 @@ All commands: Run "npm help find-dupes" for more info - fund npm fund - - Retrieve funding information + fund Retrieve funding information Usage: npm fund [[<@scope>/]] @@ -485,18 +443,14 @@ All commands: Run "npm help fund" for more info - get npm get - - Get a value from the npm configuration + get Get a value from the npm configuration Usage: npm get [ ...] (See \`npm config\`) Run "npm help get" for more info - help npm help - - Get help on npm + help Get help on npm Usage: npm help [] @@ -508,9 +462,7 @@ All commands: Run "npm help help" for more info - hook npm hook - - Manage registry hooks + hook Manage registry hooks Usage: npm hook add [--type=] @@ -523,9 +475,7 @@ All commands: Run "npm help hook" for more info - init npm init - - Create a package.json file + init Create a package.json file Usage: npm init [--force|-f|--yes|-y|--scope] @@ -541,9 +491,7 @@ All commands: Run "npm help init" for more info - install npm install - - Install a package + install Install a package Usage: npm install [<@scope>/] @@ -570,9 +518,7 @@ All commands: Run "npm help install" for more info - install-ci-test npm install-ci-test - - Install a project with a clean slate and run tests + install-ci-test Install a project with a clean slate and run tests Usage: npm install-ci-test @@ -585,9 +531,7 @@ All commands: Run "npm help install-ci-test" for more info - install-test npm install-test - - Install package(s) and run tests + install-test Install package(s) and run tests Usage: npm install-test [<@scope>/] @@ -614,9 +558,7 @@ All commands: Run "npm help install-test" for more info - link npm link - - Symlink a package folder + link Symlink a package folder Usage: npm link (in package dir) @@ -635,9 +577,7 @@ All commands: Run "npm help link" for more info - ll npm ll - - List installed packages + ll List installed packages Usage: npm ll [[<@scope>/] ...] @@ -653,9 +593,7 @@ All commands: Run "npm help ll" for more info - login npm adduser - - Add a registry user account + login Add a registry user account Usage: npm adduser @@ -667,9 +605,7 @@ All commands: Run "npm help adduser" for more info - logout npm logout - - Log out of the registry + logout Log out of the registry Usage: npm logout @@ -679,9 +615,7 @@ All commands: Run "npm help logout" for more info - ls npm ls - - List installed packages + ls List installed packages Usage: npm ls [[<@scope>/] ...] @@ -697,9 +631,7 @@ All commands: Run "npm help ls" for more info - org npm org - - Manage orgs + org Manage orgs Usage: npm org set orgname username [developer | admin | owner] @@ -713,9 +645,7 @@ All commands: Run "npm help org" for more info - outdated npm outdated - - Check for outdated packages + outdated Check for outdated packages Usage: npm outdated [[<@scope>/] ...] @@ -726,9 +656,7 @@ All commands: Run "npm help outdated" for more info - owner npm owner - - Manage package owners + owner Manage package owners Usage: npm owner add [<@scope>/] @@ -742,9 +670,7 @@ All commands: Run "npm help owner" for more info - pack npm pack - - Create a tarball from a package + pack Create a tarball from a package Usage: npm pack [[<@scope>/]...] @@ -756,9 +682,7 @@ All commands: Run "npm help pack" for more info - ping npm ping - - Ping npm registry + ping Ping npm registry Usage: npm ping @@ -768,9 +692,7 @@ All commands: Run "npm help ping" for more info - pkg npm pkg - - Manages your package.json + pkg Manages your package.json Usage: npm pkg set = [= ...] @@ -786,9 +708,7 @@ All commands: Run "npm help pkg" for more info - prefix npm prefix - - Display prefix + prefix Display prefix Usage: npm prefix [-g] @@ -798,9 +718,7 @@ All commands: Run "npm help prefix" for more info - profile npm profile - - Change settings on your registry profile + profile Change settings on your registry profile Usage: npm profile enable-2fa [auth-only|auth-and-writes] @@ -813,9 +731,7 @@ All commands: Run "npm help profile" for more info - prune npm prune - - Remove extraneous packages + prune Remove extraneous packages Usage: npm prune [[<@scope>/]...] @@ -828,9 +744,7 @@ All commands: Run "npm help prune" for more info - publish npm publish - - Publish a package + publish Publish a package Usage: npm publish [] @@ -842,9 +756,7 @@ All commands: Run "npm help publish" for more info - rebuild npm rebuild - - Rebuild a package + rebuild Rebuild a package Usage: npm rebuild [[<@scope>/][@] ...] @@ -858,9 +770,7 @@ All commands: Run "npm help rebuild" for more info - repo npm repo - - Open package repository page in the browser + repo Open package repository page in the browser Usage: npm repo [ [ ...]] @@ -872,9 +782,7 @@ All commands: Run "npm help repo" for more info - restart npm restart - - Restart a package + restart Restart a package Usage: npm restart [-- ] @@ -884,9 +792,7 @@ All commands: Run "npm help restart" for more info - root npm root - - Display npm root + root Display npm root Usage: npm root @@ -896,9 +802,7 @@ All commands: Run "npm help root" for more info - run-script npm run-script - - Run arbitrary package scripts + run-script Run arbitrary package scripts Usage: npm run-script [-- ] @@ -912,9 +816,7 @@ All commands: Run "npm help run-script" for more info - search npm search - - Search for packages + search Search for packages Usage: npm search [search terms ...] @@ -928,18 +830,14 @@ All commands: Run "npm help search" for more info - set npm set - - Set a value in the npm configuration + set Set a value in the npm configuration Usage: npm set = [= ...] (See \`npm config\`) Run "npm help set" for more info - set-script npm set-script - - Set tasks in the scripts section of package.json + set-script Set tasks in the scripts section of package.json Usage: npm set-script [