{"name":"archiver","version":"8.0.0","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"git+https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","type":"module","exports":"./index.js","engines":{"node":">=18"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"async":"^3.2.4","buffer-crc32":"^1.0.0","is-stream":"^4.0.0","lazystream":"^1.0.0","normalize-path":"^3.0.0","readable-stream":"^4.0.0","readdir-glob":"^3.0.0","tar-stream":"^3.0.0","zip-stream":"^7.0.2"},"devDependencies":{"archiver-jsdoc-theme":"1.1.3","chai":"6.2.2","jsdoc":"4.0.5","mkdirp":"3.0.1","mocha":"11.7.5","prettier":"3.8.3","rimraf":"6.1.3","stream-bench":"0.1.2","tar":"6.2.1","yauzl":"3.3.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"gitHead":"52d1d349dfa2bf17956ecab56f477736688a9c5e","_id":"archiver@8.0.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-fV1orZfsnPn9BaSByR/qE67rJCLJEy2Ox5bq7nJh+jquWaNh6Sfec75kJ2T6PtdGUbPQlrVoSVCEOa5SdiTQ1g==","shasum":"b02b8d0b978488e6dbebf1e0ebbc4103f5ffae3b","tarball":"http://registry-npm.ywwl.com/archiver/download/archiver-8.0.0.tgz","fileCount":10,"unpackedSize":39604,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/archiver@8.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHxeKOmiWyvVfydKnt41IMJVZ+UIix+gJG+S6OXGjEhpAiEAjBhVDJsQS9LlEMiHaDyEbU8vR0nRUjcF1JjBRJrOroU="}],"size":10159,"noattachment":false,"key":"/archiver/-/archiver-8.0.0.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f005409b-d2bd-4482-b3d0-a429c09816fd"}},"directories":{},"maintainers":[{"name":"ctalkington","email":"chris@talkingtontech.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/archiver_8.0.0_1778227523124_0.38427703134659064"},"_hasShrinkwrap":false,"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\nimport fs from \"fs\";\nimport { ZipArchive } from \"archiver\";\n\n// create a file to stream archive data to.\nconst output = fs.createWriteStream(__dirname + \"/example.zip\");\nconst archive = new ZipArchive({\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(\n    \"archiver has been finalized and the output file descriptor has closed.\",\n  );\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","publish_time":1778227523358,"_cnpm_publish_time":1778227523358,"dist-tags":{"canary":"0.15.0-1","latest":"8.0.0"}}