npm-check-updates 19.0.0 → 19.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/build/index.d.ts +4 -1
- package/build/index.js +116 -107
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -460,6 +460,18 @@ Note for latest/tag targets:
|
|
|
460
460
|
|
|
461
461
|
> :warning: For packages that update frequently (e.g. daily releases), using a long cooldown period (7+ days) with the default `--target latest` or `--target @tag` may prevent all updates since new versions will be published before older ones meet the cooldown requirement. Please consider this when setting your cooldown period.
|
|
462
462
|
|
|
463
|
+
You can also provide a custom function in your .ncurc.js file or when importing npm-check-updates as a module.
|
|
464
|
+
|
|
465
|
+
> :warning: The predicate function is only available in .ncurc.js or when importing npm-check-updates as a module, not on the command line. To convert a JSON config to a JS config, follow the instructions at https://github.com/raineorshine/npm-check-updates#config-functions.
|
|
466
|
+
|
|
467
|
+
```js
|
|
468
|
+
/** Set cooldown to 3 days but skip it for `@my-company` packages.
|
|
469
|
+
@param packageName The name of the dependency.
|
|
470
|
+
@returns Cooldown days restriction for given package (when null cooldown will be skipped for given package).
|
|
471
|
+
*/
|
|
472
|
+
cooldown: packageName => (packageName.startsWith('@my-company') ? null : 3)
|
|
473
|
+
```
|
|
474
|
+
|
|
463
475
|
## doctor
|
|
464
476
|
|
|
465
477
|
Usage:
|
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { SemVer } from 'semver-utils';
|
|
2
2
|
|
|
3
|
+
/** A function that can be provided to the --cooldown option for custom cooldown predicate. */
|
|
4
|
+
declare type CooldownFunction = (packageName: string) => number | null;
|
|
5
|
+
|
|
3
6
|
/**
|
|
4
7
|
* TypeScript helper for .npmrc config file. Similar to vite and eslint's
|
|
5
8
|
* defineConfig helper
|
|
@@ -102,7 +105,7 @@ export declare interface RunOptions {
|
|
|
102
105
|
/** Directory of .ncurc config file. (default: directory of `packageFile`) */
|
|
103
106
|
configFilePath?: string;
|
|
104
107
|
/** Sets a minimum age (in days) for package versions to be considered for upgrade, reducing the risk of installing newly published, potentially compromised packages. Run "ncu --help --cooldown" for details. */
|
|
105
|
-
cooldown?: number;
|
|
108
|
+
cooldown?: number | CooldownFunction;
|
|
106
109
|
/** Working directory in which npm will be executed. */
|
|
107
110
|
cwd?: string;
|
|
108
111
|
/** Run recursively in current working directory. Alias of (`--packageFile '**\/package.json'`). */
|