async function initialFilesScan(targetPath, option = {}) {
  /**  M2 Save files meta data to database */
  console.log(`Initial files scanning begins`);
  try {
    const filesPath = await recurReaddir(targetPath, option);
    filesPath.forEach(filePath => {
      console.log(`${filePath}`);
    });
  } catch (err) {
    throw new Error(`Error occurs at initialFilesScan: ${err.message}`);
  }
}
/** First scan when app is initiating
 * Cannot use the watcher.on("all") becasue it is possible to predict
 * when the event is coming to end; Must use nodejs fs module
 * @param targetPath: String
 * The path the scan to begin with
 * @param option: Object. Default to {}
 * @property filterDirs: string[]
 * The path to filter
 */
First scan when app is initiating
Cannot use the watcher.on("all") becasue it is possible to predict
when the event is coming to end; Must use nodejs fs module
@param targetPath: String
The path the scan to begin with
@param option: Object. Default to {}
@property filterDirs: string[]
The path to filter
First scan when app is initiating Cannot use the watcher . on ( " all " ) becasue it is possible to predict when the event is coming to end ; Must use nodejs fs module @param targetPath : String The path the scan to begin with @param option : Object . Default to {} @property filterDirs : string [] The path to filter
async function initialFilesScan(targetPath, option = {}) {
  console.log(`Initial files scanning begins`);
  try {
    const filesPath = await recurReaddir(targetPath, option);
    filesPath.forEach(filePath => {
      console.log(`${filePath}`);
    });
  } catch (err) {
    throw new Error(`Error occurs at initialFilesScan: ${err.message}`);
  }
}
async function initialFilesScan ( targetPath , option = { } ) { console . log ( ` ` ) ; try { const filesPath = await recurReaddir ( targetPath , option ) ; filesPath . forEach ( filePath => { console . log ( ` ${ filePath } ` ) ; } ) ; } catch ( err ) { throw new Error ( ` ${ err . message } ` ) ; } }
First scan when app is initiating
 Cannot use the watcher.on("all") becasue it is possible to predict
 when the event is coming to end; Must use nodejs fs module
 @param targetPath: String
 The path the scan to begin with
 @param option: Object.
First scan when app is initiating Cannot use the watcher . on ( " all " ) becasue it is possible to predict when the event is coming to end ; Must use nodejs fs module @param targetPath : String The path the scan to begin with @param option : Object .
/**  M2 Save files meta data to database */