nl_tokens: Zips a list of files or directories
pl_tokens: function zip ( zipFile , srcList , dstPath ) { if ( ! dstPath ) { dstPath = false ; } const output = fs . createWriteStream ( zipFile ) ; const archive = archiver ( 'zip' , { zlib : { level : 9 } // Sets the compression level. } ) ; return new Promise ( ( resolve , reject ) => { output . on ( 'close' , function ( ) { return resolve ( ) ; } ) ; archive . on ( 'warning' , function ( err ) { if ( err . code === 'ENOENT' ) { console . log ( err ) ; } else { return reject ( err ) ; } } ) ; archive . on ( 'error' , function ( err ) { return reject ( err ) ; } ) ; archive . pipe ( output ) ; srcList . forEach ( ( src ) => { const stat = fs . lstatSync ( src ) ; if ( stat . isFile ( ) ) { archive . file ( src ) ; } else if ( stat . isDirectory ( ) || stat . isSymbolicLink ( ) ) { archive . directory ( src , dstPath ) ; } else { return reject ( <mask> Error ( 'Invalid path' ) ) ; } } ) ; archive . finalize ( ) ; } ) ; }