06-build-page/index.js
/**
   * Get array urls and append data from this files to one file(destination URL)
   * @param {Array} urlArray 
   * @param {string} destUrl 
   */
Get array urls and append data from this files to one file(destination URL)
@param {Array} urlArray
@param {string} destUrl
Get array urls and append data from this files to one file ( destination URL ) @param { Array } urlArray @param { string } destUrl
async function appendToBundle(urlArray, destUrl) {  
    if(Array.isArray(urlArray) === false) urlArray = [urlArray];
    if (urlArray.length === 0) return 
    let srcUrl = await urlArray.shift()
      try { 
        let data = await readFile(srcUrl);
        let success = await fsPromise.appendFile(destUrl , data)
        if (success === undefined) appendToBundle(urlArray, destUrl);
      } catch(error) {
        console.log('Error to append:', error.message);
      }
  }
async function appendToBundle ( urlArray , destUrl ) { if ( Array . isArray ( urlArray ) === false ) urlArray = [ urlArray ] ; if ( urlArray . length === 0 ) return let srcUrl = await urlArray . shift ( ) try { let data = await readFile ( srcUrl ) ; let success = await fsPromise . appendFile ( destUrl , data ) if ( success === undefined ) appendToBundle ( urlArray , destUrl ) ; } catch ( error ) { console . log ( 'Error to append:' , error . message ) ; } }
Get array urls and append data from this files to one file(destination URL)
 @param {Array} urlArray
 @param {string} destUrl
Get array urls and append data from this files to one file ( destination URL ) @param { Array } urlArray @param { string } destUrl