npm-pkg-lint 2.2.0 → 2.3.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/dist/index.js CHANGED
@@ -17716,6 +17716,10 @@ function getFilePath(key) {
17716
17716
  const filename2 = `${hash.slice(0, 2)}/${hash.slice(2)}.json`;
17717
17717
  return path5.join(cacheDir, filename2);
17718
17718
  }
17719
+ async function setCacheDirecory(directory2) {
17720
+ await fs3.mkdir(directory2, { recursive: true });
17721
+ cacheDir = directory2;
17722
+ }
17719
17723
  async function persistentCacheGet(key) {
17720
17724
  if (!enabled) {
17721
17725
  return null;
@@ -18093,6 +18097,7 @@ async function run() {
18093
18097
  parser.add_argument("-v", "--version", { action: "version", version });
18094
18098
  parser.add_argument("-t", "--tarball", { help: "specify tarball location" });
18095
18099
  parser.add_argument("-p", "--pkgfile", { help: "specify package.json location" });
18100
+ parser.add_argument("--cache", { help: "specify cache directory" });
18096
18101
  parser.add_argument("--allow-types-dependencies", {
18097
18102
  action: "store_true",
18098
18103
  help: "allow dependencies to `@types/*`"
@@ -18102,6 +18107,9 @@ async function run() {
18102
18107
  help: "ignore errors for missing fields (but still checks for empty and valid)"
18103
18108
  });
18104
18109
  const args = parser.parse_args();
18110
+ if (args.cache) {
18111
+ await setCacheDirecory(args.cache);
18112
+ }
18105
18113
  let regenerateReportName = false;
18106
18114
  if (args.tarball === "-") {
18107
18115
  args.tarball = await preloadStdin();