@@ -30,7 +30,7 @@ function logDetails(result) {
3030
3131function logModule ( result ) {
3232 if ( outputFormat === "json" ) {
33- console . log ( JSON . stringify ( result , ' ' , 4 ) ) ;
33+ console . log ( JSON . stringify ( result , null , 4 ) ) ;
3434 return ;
3535 }
3636 var table = plainTable ( { plain :true } ) ;
@@ -43,7 +43,7 @@ function logModule(result) {
4343
4444function logList ( result ) {
4545 if ( outputFormat === "json" ) {
46- console . log ( JSON . stringify ( result , ' ' , 4 ) ) ;
46+ console . log ( JSON . stringify ( result , null , 4 ) ) ;
4747 return ;
4848 }
4949 if ( result . nodes ) { // summary of node-module
@@ -55,7 +55,7 @@ function logList(result) {
5555
5656function logNodeSet ( node ) {
5757 if ( outputFormat === "json" ) {
58- console . log ( JSON . stringify ( node , ' ' , 4 ) ) ;
58+ console . log ( JSON . stringify ( node , null , 4 ) ) ;
5959 return ;
6060 }
6161 if ( Array . isArray ( node ) ) {
@@ -76,7 +76,7 @@ function logNodeSet(node) {
7676
7777function logNodeList ( nodes ) {
7878 if ( outputFormat === "json" ) {
79- console . log ( JSON . stringify ( nodes , ' ' , 4 ) ) ;
79+ console . log ( JSON . stringify ( nodes , null , 4 ) ) ;
8080 return ;
8181 }
8282 if ( ! Array . isArray ( nodes ) ) {
@@ -120,7 +120,7 @@ function logNodeList(nodes) {
120120
121121function logProjectList ( projects ) {
122122 if ( outputFormat === "json" ) {
123- console . log ( JSON . stringify ( projects , ' ' , 4 ) ) ;
123+ console . log ( JSON . stringify ( projects , null , 4 ) ) ;
124124 return ;
125125 }
126126 var projectList = projects . projects || [ ] ;
@@ -156,27 +156,27 @@ module.exports = {
156156 if ( msg . response ) {
157157 if ( msg . response . status === 401 ) {
158158 if ( outputFormat === "json" ) {
159- console . log ( JSON . stringify ( { error :"Not logged in. Use 'login' to log in." , status : 401 } , " " , 4 ) ) ;
159+ console . log ( JSON . stringify ( { error :"Not logged in. Use 'login' to log in." , status : 401 } , null , 4 ) ) ;
160160 } else {
161161 console . warn ( "Not logged in. Use 'login' to log in." ) ;
162162 }
163163 } else if ( msg . response . data ) {
164164 if ( msg . response . status === 404 && ! msg . response . data . message ) {
165165 if ( outputFormat === "json" ) {
166- console . log ( JSON . stringify ( { error :"Node-RED Admin API not found. Use 'target' to set API location" , status : 404 } , " " , 4 ) ) ;
166+ console . log ( JSON . stringify ( { error :"Node-RED Admin API not found. Use 'target' to set API location" , status : 404 } , null , 4 ) ) ;
167167 } else {
168168 console . warn ( "Node-RED Admin API not found. Use 'target' to set API location" ) ;
169169 }
170170 } else {
171171 if ( outputFormat === "json" ) {
172- console . log ( JSON . stringify ( { error :msg . response . data . message , status : msg . response . status } , " " , 4 ) ) ;
172+ console . log ( JSON . stringify ( { error :msg . response . data . message , status : msg . response . status } , null , 4 ) ) ;
173173 } else {
174174 console . warn ( msg . response . status + ": " + msg . response . data . message ) ;
175175 }
176176 }
177177 } else {
178178 if ( outputFormat === "json" ) {
179- console . log ( JSON . stringify ( { error :msg . toString ( ) , status : msg . response . status } , " " , 4 ) ) ;
179+ console . log ( JSON . stringify ( { error :msg . toString ( ) , status : msg . response . status } , null , 4 ) ) ;
180180 } else {
181181 console . warn ( msg . response . status + ": " + msg . toString ( ) ) ;
182182 }
0 commit comments