{"name":"archiver","version":"0.11.0-alpha","description":"a streaming interface for archive generation","homepage":"https://github.com/ctalkington/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/ctalkington/node-archiver.git"},"bugs":{"url":"https://github.com/ctalkington/node-archiver/issues"},"licenses":[{"type":"MIT","url":"https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT"}],"main":"lib/archiver.js","files":["lib","LICENSE-MIT"],"engines":{"node":">= 0.10.0"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"async":"~0.9.0","buffer-crc32":"~0.2.1","glob":"~3.2.6","lazystream":"~0.1.0","lodash":"~2.4.1","readable-stream":"~1.0.26","tar-stream":"~0.4.0","zip-stream":"~0.3.0"},"devDependencies":{"chai":"~1.9.1","mocha":"~1.20.1","rimraf":"~2.2.8","mkdirp":"~0.5.0","stream-bench":"~0.1.2"},"keywords":["archive","archiver","stream","zip","tar"],"gitHead":"fc9937d0c62dcafaf78bfdf456669fe9de85f3dd","_id":"archiver@0.11.0-alpha","_shasum":"7ba132722723b02f975a5180c8f438aea8937a5a","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"ctalkington","email":"chris@christalkington.com"},"maintainers":[{"name":"ctalkington","email":"chris@christalkington.com"}],"dist":{"shasum":"7ba132722723b02f975a5180c8f438aea8937a5a","tarball":"http://registry-npm.ywwl.com/archiver/download/archiver-0.11.0-alpha.tgz","integrity":"sha512-xZxuziNdi4Op3kQJ0TFE4thOgvIL3VA8GYHXw8Fuw7tstVSepod3VqLX7p3ESK4DUjvxO0lmC7EYPtu8S3NH5Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDadLqGtoYHfVXExMNQJqWglpe1V+AIHbUD/rEAZL2JvQIgHKccj+xLYeV3fOEx8aDjx1upAkiuguZmu6Gkr9dYo7M="}],"size":8592,"noattachment":false,"key":"/archiver/-/archiver-0.11.0-alpha.tgz"},"directories":{},"readme":"# Archiver\n\nA streaming interface for archive generation\n\nVisit the [API documentation](https://www.archiverjs.com/) for a list of all methods available.\n\n## Install\n\n```bash\nnpm install archiver --save\n```\n\n## Quick Start\n\n```js\n// require modules\nconst fs = require('fs');\nconst archiver = require('archiver');\n\n// create a file to stream archive data to.\nconst output = fs.createWriteStream(__dirname + '/example.zip');\nconst archive = archiver('zip', {\n  zlib: { level: 9 } // Sets the compression level.\n});\n\n// listen for all archive data to be written\n// 'close' event is fired only when a file descriptor is involved\noutput.on('close', function() {\n  console.log(archive.pointer() + ' total bytes');\n  console.log('archiver has been finalized and the output file descriptor has closed.');\n});\n\n// This event is fired when the data source is drained no matter what was the data source.\n// It is not part of this library but rather from the NodeJS Stream API.\n// @see: https://nodejs.org/api/stream.html#stream_event_end\noutput.on('end', function() {\n  console.log('Data has been drained');\n});\n\n// good practice to catch warnings (ie stat failures and other non-blocking errors)\narchive.on('warning', function(err) {\n  if (err.code === 'ENOENT') {\n    // log warning\n  } else {\n    // throw error\n    throw err;\n  }\n});\n\n// good practice to catch this error explicitly\narchive.on('error', function(err) {\n  throw err;\n});\n\n// pipe archive data to the file\narchive.pipe(output);\n\n// append a file from stream\nconst file1 = __dirname + '/file1.txt';\narchive.append(fs.createReadStream(file1), { name: 'file1.txt' });\n\n// append a file from string\narchive.append('string cheese!', { name: 'file2.txt' });\n\n// append a file from buffer\nconst buffer3 = Buffer.from('buff it!');\narchive.append(buffer3, { name: 'file3.txt' });\n\n// append a file\narchive.file('file1.txt', { name: 'file4.txt' });\n\n// append files from a sub-directory and naming it `new-subdir` within the archive\narchive.directory('subdir/', 'new-subdir');\n\n// append files from a sub-directory, putting its contents at the root of archive\narchive.directory('subdir/', false);\n\n// append files from a glob pattern\narchive.glob('file*.txt', {cwd:__dirname});\n\n// finalize the archive (ie we are done appending files but streams have to finish yet)\n// 'close', 'end' or 'finish' may be fired right after calling this method so register to them beforehand\narchive.finalize();\n```\n\n## Formats\n\nArchiver ships with out of the box support for TAR and ZIP archives.\n\nYou can register additional formats with `registerFormat`.\n\nYou can check if format already exists before to register a new one with `isRegisteredFormat`.\n","publish_time":1405286146953,"_cnpm_publish_time":1405286146953,"dist-tags":{"canary":"0.15.0-1","latest":"8.0.0"}}