@@ -104,7 +104,7 @@ function maybeReadFile (name) {
104104 }
105105 } )
106106 . catch ( { code : 'ENOENT' } , ( ) => null )
107- . catch ( ex => {
107+ . catch ( ( ex ) => {
108108 ex . file = file
109109 throw ex
110110 } )
@@ -156,7 +156,7 @@ function auditCmd (args, cb) {
156156 ( pkgJson && pkgJson . dependencies ) || { } ,
157157 ( pkgJson && pkgJson . devDependencies ) || { }
158158 )
159- return lockVerify ( npm . prefix ) . then ( result => {
159+ return lockVerify ( npm . prefix ) . then ( ( result ) => {
160160 if ( result . status ) return audit . generate ( sw , requires )
161161
162162 const lockFile = shrinkwrap ? 'npm-shrinkwrap.json' : 'package-lock.json'
@@ -167,7 +167,7 @@ function auditCmd (args, cb) {
167167 } )
168168 } ) . then ( ( auditReport ) => {
169169 return audit . submitForFullReport ( auditReport )
170- } ) . catch ( err => {
170+ } ) . catch ( ( err ) => {
171171 if ( err . statusCode === 404 || err . statusCode >= 500 ) {
172172 const ne = new Error ( `Your configured registry (${ npm . config . get ( 'registry' ) } ) does not support audit requests.` )
173173 ne . code = 'ENOAUDIT'
@@ -262,7 +262,11 @@ function auditCmd (args, cb) {
262262 auditResult . metadata . vulnerabilities . high +
263263 auditResult . metadata . vulnerabilities . critical
264264 if ( vulns > 0 ) process . exitCode = 1
265- return audit . printFullReport ( auditResult )
265+ if ( npm . config . get ( 'parseable' ) ) {
266+ return audit . printParseableReport ( auditResult )
267+ } else {
268+ return audit . printFullReport ( auditResult )
269+ }
266270 }
267271 } ) . asCallback ( cb )
268272}
0 commit comments