Skip to content

Commit

Permalink
Rename batchRequests to concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
raineorshine committed Mar 26, 2020
1 parent 72b3a6c commit a8287e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ $ ncu "/^(?!gulp-).*$/" # windows
Options
--------------

--configFilePath rc config file path (default: directory of `packageFile` or ./ otherwise)
--configFileName rc config file name (default: .ncurc.{json,yml,js})
--cwd Used as current working directory for `spawn` in npm listing
--concurrency max number of concurrent HTTP requests to npm registry
(default: 8)
--configFilePath rc config file path (default: directory of
`packageFile` or ./ otherwise)
--configFileName rc config file name (default: .ncurc.{json,yml,js}) --cwd Used as current working directory for `spawn` in npm
listing
--dep check only a specific section(s) of dependencies:
prod|dev|peer|optional|bundle (comma-delimited)
--engines-node include only packages that satisfy engines.node as
Expand Down
2 changes: 1 addition & 1 deletion bin/ncu
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ if (notifier.update && notifier.update.latest !== pkg.version) {
program
.description('[filter] is a list or regex of package names to check (all others will be ignored).')
.usage('[options] [filter]')
.option('--concurrency <n>', 'max number of concurrent HTTP requests to npm registry (default: 8).', parseInt, 8)
.option('--configFilePath <path>', 'rc config file path (default: directory of `packageFile` or ./ otherwise)')
.option('--configFileName <path>', 'rc config file name (default: .ncurc.{json,yml,js})')
.option('--cwd <path>', 'Used as current working directory for `spawn` in npm listing')
Expand Down Expand Up @@ -46,7 +47,6 @@ program
.option('-t, --greatest', 'find the highest versions available instead of the latest stable versions')
.option('--timeout <ms>', 'a global timeout in ms')
.option('-u, --upgrade', 'overwrite package file')
.option('--requests-batch-size <n>','requests to npm registry are issued in batches whose size is determined by this option',parseInt,8)
.option('-x, --reject <matches>', 'exclude packages matching the given string, comma-or-space-delimited list, or /regex/')
.option('-v, --version', pkg.version, () => {
console.log(pkg.version);
Expand Down
4 changes: 2 additions & 2 deletions lib/versionmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ function upgradePackageDefinitions(currentDependencies, options) {
loglevel: options.loglevel,
enginesNode: options.enginesNode,
timeout: options.timeout,
batchSize: options.requestsBatchSize
concurrency: options.concurrency
}).then(latestVersions => {

const upgradedDependencies = upgradeDependencies(currentDependencies, latestVersions, {
Expand Down Expand Up @@ -456,7 +456,7 @@ function queryVersions(packageMap, options = {}) {
return cint.keyValue(packageList[i], version);
});
}
return pMap(packageList,getPackageVersionProtected,{concurrency: options.batchSize})
return pMap(packageList,getPackageVersionProtected, {concurrency: options.concurrency})
.then(zipVersions)
.then(_.partialRight(_.pickBy, _.identity));
}
Expand Down

0 comments on commit a8287e9

Please sign in to comment.