npq 3.4.6 → 3.4.8

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.
@@ -70,7 +70,6 @@ class Marshall extends BaseMarshall {
70
70
  // get date in ms
71
71
  const currentDate = new Date()
72
72
  const dateDiffInMsVersionPublished = currentDate - new Date(versionPublishedDateString)
73
- console.log(dateDiffInMsVersionPublished)
74
73
  let dateDiffVersionPublished = 0
75
74
  if (dateDiffInMsVersionPublished > 0) {
76
75
  dateDiffVersionPublished = Math.round(dateDiffInMsVersionPublished / (1000 * 60 * 60 * 24))
@@ -1,10 +1,12 @@
1
1
  'use strict'
2
2
 
3
3
  const BaseMarshall = require('./baseMarshall')
4
+ const Warning = require('../helpers/warning')
4
5
  const { marshallCategories } = require('./constants')
5
6
 
6
7
  const MARSHALL_NAME = 'downloads'
7
- const DOWNLOAD_COUNT_THRESHOLD = 20 // threshold per month
8
+ const DOWNLOAD_COUNT_THRESHOLD = 100 // threshold per month
9
+ const DOWNLOAD_COUNT_UPPER_THRESHOLD = 10000 // threshold per month
8
10
 
9
11
  class Marshall extends BaseMarshall {
10
12
  constructor(options) {
@@ -25,6 +27,12 @@ class Marshall extends BaseMarshall {
25
27
  )
26
28
  }
27
29
 
30
+ if (downloadCount < DOWNLOAD_COUNT_UPPER_THRESHOLD) {
31
+ throw new Warning(
32
+ `detected a low relatively low download-count package (${downloadCount} downloads last month)`
33
+ )
34
+ }
35
+
28
36
  return downloadCount
29
37
  })
30
38
  }
@@ -54,7 +54,7 @@ class Marshall extends BaseMarshall {
54
54
 
55
55
  if (data && data.issuesCount && data.issuesCount > 0) {
56
56
  const packageSecurityInfo = `${SNYK_PACKAGE_PAGE}${encodeURIComponent(pkg.packageName)}`
57
- throw new Error(`${data.issuesCount} vulnerabilitie(s) found: ${packageSecurityInfo}`)
57
+ throw new Error(`${data.issuesCount} vulnerable path(s) found: ${packageSecurityInfo}`)
58
58
  }
59
59
 
60
60
  return data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npq",
3
- "version": "3.4.6",
3
+ "version": "3.4.8",
4
4
  "description": "marshall your npm/npm package installs with high quality and class 🎖",
5
5
  "bin": {
6
6
  "npq": "./bin/npq.js",