Newton's Preposterous Miscalculation

    archiver-promise

    1.0.0 • Public • Published

    archiver-promise

    Promise wrapper for archiver

     
    var archiver = require('archiver-promise');
     
    var archive = archiver('path/to/file.zip',{
      store: true
      // more options https://archiverjs.com/docs/
    });
     
    // append a file from stream
    var file1 = __dirname + '/file1.txt';
    archive.append(fs.createReadStream(file1), { name: 'file1.txt' });
     
    // append a file from string
    archive.append('string cheese!', { name: 'file2.txt' });
     
    // append a file from buffer
    var buffer3 = new Buffer('buff it!');
    archive.append(buffer3, { name: 'file3.txt' });
     
    // append a file
    archive.file('file1.txt', { name: 'file4.txt' });
     
    // append files from a directory
    archive.directory('subdir/');
     
    // append files from a glob pattern
    archive.glob('subdir/*.txt');
     
    // finalize the archive
    archive.finalize().then(function(){
      console.log('done');
    });
     

    Install

    npm i archiver-promise

    DownloadsWeekly Downloads

    14,475

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • liangxingchen