retire 3.1.2 → 3.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.2.0]
4
+
5
+ - Add `--ext` to allow specifying other file extensions
6
+
7
+ ## [3.1.3]
8
+
9
+ - Fixes a typo
10
+
3
11
  ## [3.1.2]
4
12
 
5
13
  - Remove some unused variables and tmp files
package/README.md CHANGED
@@ -30,7 +30,7 @@ Options:
30
30
  --jsrepo <path|url> Local or internal version of repo
31
31
  --noderepo <path|url> Local or internal version of repo
32
32
  --cachedir <path> Path to use for local cache instead of /tmp/.retire-cache
33
- --proxy <url> Proxy url (http://some.sever:8080)
33
+ --proxy <url> Proxy url (http://some.host:8080)
34
34
  --outputformat <format> Valid formats: text, json, jsonsimple, depcheck (experimental), cyclonedx and cyclonedxJSON
35
35
  --outputpath <path> File to which output should be written
36
36
  --ignore <paths> Comma delimited list of paths to ignore
@@ -39,6 +39,7 @@ Options:
39
39
  --exitwith <code> Custom exit code (default: 13) when vulnerabilities are found
40
40
  --colors Enable color output (console output only)
41
41
  --insecure Enable fetching remote jsrepo/noderepo files from hosts using an insecure or self-signed SSL (TLS) certificate
42
+ --ext <extensions> Comman separated list of file extensions for javascript files. The default is "js"
42
43
  --cacert <path> Use the specified certificate file to verify the peer used for fetching remote jsrepo/noderepo files
43
44
  ````
44
45
 
package/bin/retire CHANGED
@@ -51,7 +51,7 @@ program
51
51
  .option('--jsrepo <path|url>', 'Local or internal version of repo')
52
52
  .option('--noderepo <path|url>', 'Local or internal version of repo')
53
53
  .option('--cachedir <path>', 'Path to use for local cache instead of /tmp/.retire-cache')
54
- .option('--proxy <url>', 'Proxy url (http://some.sever:8080)')
54
+ .option('--proxy <url>', 'Proxy url (http://some.host:8080)')
55
55
  .option('--outputformat <format>', 'Valid formats: text, json, jsonsimple, depcheck (experimental), cyclonedx and cyclonedxJSON')
56
56
  .option('--outputpath <path>', 'File to which output should be written')
57
57
  .option('--ignore <paths>', 'Comma delimited list of paths to ignore')
@@ -60,13 +60,14 @@ program
60
60
  .option('--exitwith <code>', 'Custom exit code (default: 13) when vulnerabilities are found')
61
61
  .option('--colors', 'Enable color output (console output only)')
62
62
  .option('--insecure', 'Enable fetching remote jsrepo/noderepo files from hosts using an insecure or self-signed SSL (TLS) certificate')
63
+ .option('--ext <extensions>', 'Comman separated list of file extensions for javascript files. The default is "js"')
63
64
  .option('--cacert <path>', 'Use the specified certificate file to verify the peer used for fetching remote jsrepo/noderepo files')
64
65
  .parse(process.argv);
65
66
 
66
67
  var config = utils.extend({ path: '.' }, utils.pick(program, [
67
68
  'package', 'node', 'js', 'jspath', 'verbose', 'nodepath', 'path', 'jsrepo', 'noderepo',
68
69
  'dropexternal', 'nocache', 'proxy', 'ignore', 'ignorefile', 'outputformat', 'outputpath',
69
- 'severity', 'exitwith', 'colors', 'includemeta', 'cachedir', 'insecure', 'cacert'
70
+ 'severity', 'exitwith', 'colors', 'includemeta', 'cachedir', 'insecure', 'cacert', 'ext'
70
71
  ]));
71
72
 
72
73
  if (!config.nocache && !config.cachedir) {
package/lib/resolve.js CHANGED
@@ -69,8 +69,9 @@ function getNodeDependencies(path, limit) {
69
69
 
70
70
  function scanJsFiles(path, options) {
71
71
  var finder = walkdir.find(path, { "follow_symlinks" : false, "no_return": true });
72
+ var ext = (options.ext || "js").split(",").map(e => "." + e);
72
73
  function onFile(file){
73
- if (file.match(/\.js$/)) {
74
+ if (ext.some(e => file.endsWith(e))) {
74
75
  finder.emit('jsfile', file);
75
76
  }
76
77
  if (file.match(/\/bower.json$/)) {
package/lib/retire.js CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  var exports = exports || {};
7
- exports.version = '3.1.2';
7
+ exports.version = '3.2.0';
8
8
 
9
9
  function isDefined(o) {
10
10
  return typeof o !== 'undefined';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Erlend Oftedal <erlend@oftedal.no>",
3
3
  "name": "retire",
4
4
  "description": "Retire is a tool for detecting use of vulnerable libraries",
5
- "version": "3.1.2",
5
+ "version": "3.2.0",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",