Skip to content

maichong/archiver-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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');
});

About

Promise wrapper for archiver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published