{"_id":"@caldwell619/zip-dir","name":"@caldwell619/zip-dir","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@caldwell619/zip-dir","version":"0.0.1","description":"Zips up directories into buffers or saves zipped files to disk","scripts":{"format":"prettier --write src && prettier --write tests","lint":"eslint --ext .ts","type-check":"tsc --noEmit","test":"jest","build":"microbundle --tsconfig tsconfig.build.json --compress --target node","release":"standard-version","publish-release":"git push --follow-tags origin master && yarn publish","prepublishOnly":"yarn build","deploy":"sh scripts/publish.sh"},"dependencies":{"async":"^3.2.0","jszip":"^3.2.2"},"source":"src/index.ts","main":"dist/index.js","license":"MIT","repository":{"type":"git","url":"http://github.com/christopher-caldwell/node-zip-dir"},"bugs":{"url":"http://github.com/christopher-caldwell/node-zip-dir/issues"},"keywords":["zipper","node","zip"],"devDependencies":{"@types/async":"^3.2.12","@types/buffer-equal":"^1.0.0","@types/colors":"^1.2.1","@types/fs-extra":"^9.0.13","@types/jest":"^27.0.3","@types/node":"^17.0.25","@types/unzipper":"^0.10.5","buffer-equal":"^1.0.0","chai":"*","eslint":"^8.13.0","eslint-plugin-prettier":"^4.0.0","fs-extra":"^10.1.0","jest":"^27.4.3","microbundle":"^0.14.2","mocha":"*","prettier":"^2.6.2","rc":"^1.2.8","ts-jest":"^27.1.4","tscpaths":"^0.0.9","typescript":"^4.6.3","unzipper":"^0.10.11"},"licenseText":"Copyright (c) 2013 Jordan Santell\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","_id":"@caldwell619/zip-dir@0.0.1","dist":{"shasum":"0e83bc7616ff0b61dcb0a3c58691026a3012d3c0","integrity":"sha512-p9JF3GdE0pgUNa1r/qlsIQBYnrfHqEWuckEo7A9l2aJnFyXu0pIAdbAQsEuKd0a/rOM1jLZNItXUP0Yus3ZLUw==","tarball":"https://registry.npmjs.org/@caldwell619/zip-dir/-/zip-dir-0.0.1.tgz","fileCount":14,"unpackedSize":29947,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcSRuNRD5NHNsMjJ4zByLYRdglscCcemMejNAmqIbFuQIgAnWesXnxretplHai+ezVVN/lv7UO8tI0rE03M1J7M7U="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYsZiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJKRAAoYDNCg01eLaFyInPZTRbVONfhPwmfOt9XHVOOpVP3LzPWvGG\r\nNwv5kMeG4I5V0ETc+1QMJiQYKLaqEOaLn+6SCxXOP1oluyqitsnLaQBvdoPW\r\nQEaioreNXx7H3VLJU8ao/DnZAMKNmImkvF7Ig8J2m2QdStxVo0tHX1297s7m\r\nGbO8YvHrqUEGYQmrrWf4njmB7mpkmb0JX/YE+dDSXQuZ6RRsybGOV+RxmWJ0\r\nhXT7w6W9jtCgcZrYr2Ut7K6aHNy/raP//7DV21Btnc3ZylzN5hOPUIo8d2ay\r\ndZRghW9WLcUGa5UqRGbXjO4CbcfnrPuG4eX8mp1w1EYJOBW512FERVbU9BmJ\r\necMwMjVwSNZVDpZtg1AR9gGLMpvPzvAOjRWe4ADe2Pj4XXcVKSIFDgnOnYnm\r\nYKUxBTgjOLpszKZvUslowKx8BZyeXYKFT6QXKVh69zJY61j9wC6IUfiUL09Q\r\nPQuzZL2yXlf7mWYEKFLJyt5xshZuNMnHpgAVM/77bZt+i0lGmrCcCpDdspnp\r\nq5e/tOGz10+X+x3HVqdy1I/Zy4Ms72tPF6UxrqL6o1Ew6Hd+j7iJ+OTYLBwm\r\nAztAYpMVDurFfKqZMWXYYA1sLTMmu4DA26E4jOOQ3SzxG3bAFVZH8wBwoaUV\r\nfwCGTSSnewh48NToFl9YVRr86RArsN2jfNc=\r\n=fTkM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"caldwell619","email":"caldwell8814@gmail.com"},"directories":{},"maintainers":[{"name":"caldwell619","email":"caldwell8814@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zip-dir_0.0.1_1650640482011_0.1622135860086622"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-22T15:14:41.924Z","0.0.1":"2022-04-22T15:14:42.182Z","modified":"2022-04-22T15:14:42.309Z"},"maintainers":[{"name":"caldwell619","email":"caldwell8814@gmail.com"}],"description":"Zips up directories into buffers or saves zipped files to disk","keywords":["zipper","node","zip"],"repository":{"type":"git","url":"http://github.com/christopher-caldwell/node-zip-dir"},"bugs":{"url":"http://github.com/christopher-caldwell/node-zip-dir/issues"},"license":"MIT","readme":"# zip-dir\n\nZips up a directory and saves the zip to disk or returns as a buffer.\n\n[![Build Status](http://img.shields.io/travis/jsantell/node-zip-dir.svg?style=flat-square)](https://travis-ci.org/jsantell/node-zip-dir)\n[![Build Status](http://img.shields.io/npm/v/zip-dir.svg?style=flat-square)](https://www.npmjs.org/package/zip-dir)\n\n## install\n\n```\n$ npm install zip-dir\n```\n\n## example\n\n```javascript\nvar zipdir = require('zip-dir');\n\n// `buffer` is the buffer of the zipped file\nvar buffer = await zipdir('/path/to/be/zipped');\n\nzipdir('/path/to/be/zipped', function (err, buffer) {\n  // `buffer` is the buffer of the zipped file\n});\n\nzipdir('/path/to/be/zipped', { saveTo: '~/myzip.zip' }, function (err, buffer) {\n  // `buffer` is the buffer of the zipped file\n  // And the buffer was saved to `~/myzip.zip`\n});\n\n// Use a filter option to prevent zipping other zip files!\n// Keep in mind you have to allow a directory to descend into!\nzipdir('/path/to/be/zipped', { filter: (path, stat) => !/\\.zip$/.test(path) }, function (err, buffer) {\n  \n});\n\n// Use an `each` option to call a function everytime a file is added, and receives the path\nzipdir('/path/to/be/zipped', { each: path => console.log(p, \"added!\"), function (err, buffer) {\n\n});\n  \n```\n\n## methods\n\n```\nvar zipdir = require('zip-dir');\n```\n\n### zipdir(dirPath, [options], [callback]) : [Promise]\n\nZips up `dirPath` recursively preserving directory structure and returns\nthe compressed buffer on success. If the `callback` function is supplied, it will be called with `(error, buffer)` once the `zipdir` function is done. If not, the buffer or an error can be obtained from the returned promise. The `callback` and the promise are mutually exclusive. If `options` defined with a `saveTo` path, then the callback and promise will be delayed until the buffer has also\nbeen saved to disk.\n\n#### Options\n\n* `saveTo` A path to save the buffer to.\n* `filter` A function that is called for all items to determine whether or not they should be added to the zip buffer. Function is called with the `fullPath` and a `stats` object ([fs.Stats](http://nodejs.org/api/fs.html#fs_class_fs_stats)). Return true to add the item; false otherwise. To include files within directories, directories must also pass this filter.\n* `each` A function that is called everytime a file or directory is added to the zip.\n\n## TODO\n\n* Add an option to not add empty directories if there are no valid children inside\n\n## license\n\nMIT\n","readmeFilename":"README.md"}