nl_tokens: / * function dumpLoadOption that return a Promise object . This function will be called if the - l option given in command line . Reading the json file and doing some checks . When done simply calling storeJob function to add the json file content .
pl_tokens: function dumpLoadOption ( ) { let p = new Promise ( ( resolve , reject ) => { let file = jsonfile . readFileSync ( program . dumpload ) ; let fileContent = [ ] ; if ( file . hasOwnProperty ( "rows" ) && file . rows instanceof Object && file ) { if ( ! Array . isArray ( <mask> . rows ) ) fileContent . push ( file . rows ) ; else fileContent = file . rows ; } else if ( Array . isArray ( file ) ) fileContent = file ; else logger_1 . logger . log ( 'warn' , ` ` ) ; if ( fileContent . length > 0 ) { logger_1 . logger . log ( 'info' , ` ${ program . dumpload } ` ) ; storeJob ( fileContent ) . on ( 'storeDone' , ( ) => { logger_1 . logger . log ( 'success' , ` ${ program . dumpload } ${ nameDB } \n ` ) ; resolve ( ) ; } ) . on ( 'storeError' , ( err ) => { logger_1 . logger . log ( 'error' , ` ${ program . dumpload } \n ${ err } ` ) ; reject ( ) ; } ) ; } else { logger_1 . logger . log ( 'warn' , ` ` ) ; reject ( ) ; } } ) ; return p ; }