{"name":"archiver","version":"0.5.0-alpha","description":"Creates Archives (ZIP) via Node Streams.","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","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"readable-stream":"~1.1.9","zip-stream":"~0.1.0","lazystream":"~0.1.0","file-utils":"~0.1.5","lodash":"~2.4.1"},"devDependencies":{"chai":"~1.8.1","mocha":"~1.16.0","rimraf":"~2.2.0","mkdirp":"~0.3.5","stream-bench":"~0.1.2"},"keywords":["archive","archiver","zip","tar"],"_id":"archiver@0.5.0-alpha","dist":{"shasum":"8d036b1130a6d1146fdd499af4b2ff6c12df0d13","tarball":"http://registry-npm.ywwl.com/archiver/download/archiver-0.5.0-alpha.tgz","integrity":"sha512-HQ4CUzPQfMXvQmDxo6GelmdehGa8uK4jeBzCJydDovqErntK4NCNB7CofzNc9l6ssGOCQtYDKluVweDf68VxuA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFUWiXFiJhGgCoEfLiF8XMkEUn6XtdExr9g0ulCwoX5NAiB262r6QUfBiWsHHgu1cvudTEPd+u/VTLHQMJ7SBn4hcw=="}],"size":21738,"noattachment":false,"key":"/archiver/-/archiver-0.5.0-alpha.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"ctalkington","email":"chris@christalkington.com"},"maintainers":[{"name":"ctalkington","email":"chris@christalkington.com"}],"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":1389310636930,"_cnpm_publish_time":1389310636930,"dist-tags":{"canary":"0.15.0-1","latest":"8.0.0"}}