@@ -7,6 +7,7 @@ const login = require('../cli-core/analysis.js').login;
7
7
const create_global_report = require ( '../cli-core/reportGlobal.js' ) . create_global_report ;
8
8
const create_XLSX_report = require ( '../cli-core/reportExcel.js' ) . create_XLSX_report ;
9
9
const create_html_report = require ( '../cli-core/reportHtml.js' ) . create_html_report ;
10
+ const create_JSON_report = require ( "../cli-core/reportJson" ) . create_JSON_report ;
10
11
const writeToInflux = require ( "../cli-core/influxdb" ) . write ;
11
12
12
13
//launch core
@@ -83,8 +84,9 @@ async function analyse_core(options) {
83
84
await create_html_report ( reportObj , options ) ;
84
85
} else if ( reportFormat === 'influxdb' ) {
85
86
await writeToInflux ( reports , options ) ;
86
- }
87
- else {
87
+ } else if ( reportFormat === 'json' ) {
88
+ await create_JSON_report ( reportObj , options ) ;
89
+ } else {
88
90
await create_XLSX_report ( reportObj , options ) ;
89
91
}
90
92
@@ -117,7 +119,7 @@ function readHeaders(headersFile) {
117
119
118
120
function getReportFormat ( format , filename ) {
119
121
// Check if format is defined
120
- const formats = [ 'xlsx' , 'html' , 'influxdb' ] ;
122
+ const formats = [ 'xlsx' , 'html' , 'influxdb' , 'json' ] ;
121
123
if ( format && formats . includes ( format . toLowerCase ( ) ) ) {
122
124
return format . toLowerCase ( ) ;
123
125
}
@@ -136,4 +138,4 @@ function analyse(options) {
136
138
analyse_core ( options ) . catch ( e => console . error ( "ERROR : \n" , e ) )
137
139
}
138
140
139
- module . exports = analyse ;
141
+ module . exports = analyse ;
0 commit comments