How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • const fs = require('fs');
    const archiver = require('archiver');
    const output = fs.createWriteStream(`glitch_release_${+new Date()}.zip`);
    const archive = archiver('zip', {
        zlib: { level: 9 } // Sets the compression level.
    });
    
    output.on('close', () => {
        // eslint-disable-next-line no-console
        console.log(`${archive.pointer()} total bytes`);
        // eslint-disable-next-line no-console
        console.log('archiver has been finalized and the output file descriptor has closed.');
    });
    
    
    
    //...
    
    /CyberLight/caninclude MIT
  • function zipUtil(source, out) {
      const archive = archiver("zip", { zlib: { level: 9 } });
      const stream = fs.createWriteStream(out, { flags: "w" }); // Open in truncate mode
    
      return new Promise((resolve, reject) => {
        archive
          .directory(source, false, {})
          .on("error", (err) => reject(err))
          .pipe(stream);
        stream.on("close", () => resolve(out));
        archive.finalize();
      });
    }
    
    
    /spaship/spaship mit
  • async function(command, callback) {
    
            
    
            //...
    if (isConfigOk) {
                
                //...
    const archive = archiver('zip', {
                    zlib: { level: 9 }
                });
    
                archive.pipe(output);
                archive.append(fs.createReadStream(lambdaPath), { name: 'index.js' });
                archive.finalize();
    
                this.log(formatLog(`Temporary Lambda function archive created at ${lambdaArchivePath}`, 'ok'));
    
                
    
                //...
    }
            
        }
    /tobilg/lsh mit
  • function compressFolder(folder, fileName) {
      return new Promise((resolve, reject) => {
        const output = fs.createWriteStream(fileName);
        const archive = archiver('zip');
        output.on('close', resolve);
        archive.on('error', reject);
        archive.pipe(output);
        archive.directory(folder, false);
        archive.finalize();
      });
    }
    
    
    /axa-group/nlp.js MIT
  • module.exports.bundleApp = async (isRelease) => {
        
        //...
    try {
            
            //...
    if (isRelease) {
                let output = fs.createWriteStream(`dist/${binaryName}-release.zip`);
                let archive = archiver('zip', { zlib: { level: 9 } });
                archive.pipe(output);
                archive.directory(`dist/${binaryName}`, false);
                await archive.finalize();
            }
            
            //...
    }
        catch (e) {
            console.error(e);
        }
    }
    
    /neutralinojs/neutralinojs-cli mit
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples