{"_id":"@charan379/mongodb-backup","_rev":"2-7ba80427a606f1b88bfc3e29e669739e","name":"@charan379/mongodb-backup","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@charan379/mongodb-backup","version":"1.0.0","description":"This Node.js package allows you to backup a MongoDB database to a zip file.","keywords":["backup","mongodb-backup","mongodb"],"repository":{"type":"git","url":"git://github.com/charan379/mongodb-backup.git"},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"charan379"},"license":"AGPL-3.0-or-later","dependencies":{"archiver":"^5.3.1","mongodb":"^5.7.0","shelljs":"^0.8.5"},"gitHead":"483c2b7e52c7c74a646f0ce682a799f1de734504","bugs":{"url":"https://github.com/charan379/mongodb-backup/issues"},"homepage":"https://github.com/charan379/mongodb-backup#readme","_id":"@charan379/mongodb-backup@1.0.0","_nodeVersion":"19.6.0","_npmVersion":"9.4.0","dist":{"integrity":"sha512-wGMhbBESz86sBucpFYH3i9YoSqYcQoGORL3WmFV9avqGFY+C1PBDEN1suDs/Rnvj7ZtguNuRM11hPvEOY988lw==","shasum":"a897beb71676fe004ff19397ca20877febf49743","tarball":"https://registry.npmjs.org/@charan379/mongodb-backup/-/mongodb-backup-1.0.0.tgz","fileCount":6,"unpackedSize":41054,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH1jpR4jFu0W5UAmE05CCcKE4qbysWBwTXtUA0mW/CqLAiEA3JIbW2q1K3gnTQzjr1ePRQyWHgeO6f9JVtEb9oG15c4="}]},"_npmUser":{"name":"charan379","email":"charanteja379@gmail.com"},"directories":{},"maintainers":[{"name":"charan379","email":"charanteja379@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongodb-backup_1.0.0_1689953390024_0.3775390860341248"},"_hasShrinkwrap":false},"1.0.1":{"name":"@charan379/mongodb-backup","version":"1.0.1","description":"This Node.js package allows you to backup a MongoDB database to a zip file.","keywords":["backup","mongodb-backup","mongodb"],"repository":{"type":"git","url":"git://github.com/charan379/mongodb-backup.git"},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"charan379"},"license":"AGPL-3.0-or-later","dependencies":{"archiver":"^5.3.1","mongodb":"^5.7.0","shelljs":"^0.8.5"},"gitHead":"87d1b79c2b15784b253a5c84cef0b7037fa7f99a","bugs":{"url":"https://github.com/charan379/mongodb-backup/issues"},"homepage":"https://github.com/charan379/mongodb-backup#readme","_id":"@charan379/mongodb-backup@1.0.1","_nodeVersion":"19.6.0","_npmVersion":"9.4.0","dist":{"integrity":"sha512-qHe6D5w79YjUpGEiYS8c0kO88sycFFhLlU37Jo3dv9ip32EuII4I14uXpg7xV3ksQuR/DEiHDm/zQcTciJs2UA==","shasum":"e1bd070daa672500ddc197fac2352709123fccf6","tarball":"https://registry.npmjs.org/@charan379/mongodb-backup/-/mongodb-backup-1.0.1.tgz","fileCount":6,"unpackedSize":41065,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDO827e5uEYtCa16c47RxHmZfKwtq1uKKXlvQ9QgQy1UQIhAOczLguHHOTzwdcbltwgGquZqBgM4d3JIquy/SGgqL7v"}]},"_npmUser":{"name":"charan379","email":"charanteja379@gmail.com"},"directories":{},"maintainers":[{"name":"charan379","email":"charanteja379@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongodb-backup_1.0.1_1689953672052_0.9296872900239856"},"_hasShrinkwrap":false},"1.0.2":{"name":"@charan379/mongodb-backup","version":"1.0.2","description":"This Node.js package allows you to backup a MongoDB database to a zip file.","keywords":["backup","mongodb-backup","mongodb"],"repository":{"type":"git","url":"git://github.com/charan379/mongodb-backup.git"},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"charan379"},"license":"AGPL-3.0-or-later","dependencies":{"archiver":"^5.3.1","mongodb":"^5.7.0","shelljs":"^0.8.5"},"_id":"@charan379/mongodb-backup@1.0.2","gitHead":"16c55b412906ef40e67bd966205aa9fe3805342c","bugs":{"url":"https://github.com/charan379/mongodb-backup/issues"},"homepage":"https://github.com/charan379/mongodb-backup#readme","_nodeVersion":"20.6.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-671eAaks/EQfi7BBYEUntKVnH9nt3IZb8I6BuJOAJxEmYqJrn79/HQpLlsZmWxcUCD5LqiMyXb0PHaHXquCXkw==","shasum":"84d1bed2f2b57baa5e8176e2d2cc7bea99778a88","tarball":"https://registry.npmjs.org/@charan379/mongodb-backup/-/mongodb-backup-1.0.2.tgz","fileCount":6,"unpackedSize":40518,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH0NK+2JhXyJCDEYBgWC/Ew7P/58JFjtrQNe5OXHDyYQCIQClcAVuXAjnUj0zZASOFKSvYyWMPHtaAZ0nJGTYgWzHMA=="}]},"_npmUser":{"name":"charan379","email":"charanteja379@gmail.com"},"directories":{},"maintainers":[{"name":"charan379","email":"charanteja379@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongodb-backup_1.0.2_1695628627864_0.7250251362791305"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-21T15:29:49.915Z","1.0.0":"2023-07-21T15:29:50.228Z","modified":"2023-09-25T07:57:08.268Z","1.0.1":"2023-07-21T15:34:32.227Z","1.0.2":"2023-09-25T07:57:08.062Z"},"maintainers":[{"name":"charan379","email":"charanteja379@gmail.com"}],"description":"This Node.js package allows you to backup a MongoDB database to a zip file.","homepage":"https://github.com/charan379/mongodb-backup#readme","keywords":["backup","mongodb-backup","mongodb"],"repository":{"type":"git","url":"git://github.com/charan379/mongodb-backup.git"},"author":{"name":"charan379"},"bugs":{"url":"https://github.com/charan379/mongodb-backup/issues"},"license":"AGPL-3.0-or-later","readme":"# mongodb-backup\n\nThis Node.js package allows you to backup a MongoDB database to a zip file.\n\n## Usage\n\n### Method 1: Importing the Package\n\n### Installation\n\nFirst you need to install this package via npm:\n\n```bash\nnpm install @charan379/mongodb-backup\n```\n\nYou can use this package by importing the `backupDatabaseToZip` function into your Node.js application, like below\n\n\n```\nconst { backupDatabaseToZip } = require(\"mongodb-backup\");\n\nconst connectionString = 'mongodb://localhost:27017/your_database'; // Replace with your MongoDB connection string\nconst outputZipPath = 'backup.zip'; // The path where the zip file will be saved\n\nbackupDatabaseToZip(connectionString, outputZipPath)\n  .then(() => {\n    console.log('Backup completed successfully.');\n  })\n  .catch((err) => {\n    console.error('Error while performing the backup:', err);\n  });\n```\n\nIn this method, you can use the `backupDatabaseToZip` function with the desired MongoDB connection string and output zip path directly within your application.\n\n### Method 2: Command Line Usage\n\n### Installation\n\nFirst you need to clone this repository from github:\n\n```bash\ngit clone https://github.com/charan379/mongodb-backup.git\n```\n\nTo backup your MongoDB database from the command line, navigate to project folder where exportDB.js exists :\n\n```bash\ncd mongodb-backup\n```\nYou can use the provided script `exportDB.js` directly with the node command by passing the MongoDB connection string and output zip file path as runtime arguments.\n\n##### Example command:\n\n```bash\nnode exportDB.js <MONGODB_CONNECTION_STRING> <OUTPUT_ZIP_PATH>\n```\n\nReplace `<MONGODB_CONNECTION_STRING>` with your actual MongoDB connection string, and `<OUTPUT_ZIP_PATH>` with the desired path to save the backup zip file.\n\n###### For example:\n\n```bash\nnode exportDB.js mongodb://localhost:27017/my_database my_backup.zip\n```\n\nThe script will connect to the specified MongoDB database, export each collection to a JSON file, zip the files into `my_backup.zip`, and save it in the current directory.\n\n\n### Dependencies\n\nThis package depends on the following modules:\n\n[archiver](https://www.npmjs.com/package/archiver) (^5.3.1)        \n[mongodb](https://www.npmjs.com/package/mongodb) (^5.7.0)       \n[shelljs](https://www.npmjs.com/package/shelljs) (^0.8.5)       \n\n## Authors\n\n- [@charan379](https://www.github.com/charan379)\n\n## License\n\n[![AGPL License](https://img.shields.io/badge/LICENSE-GNU%20AGPLv3-brightgreen)](https://www.gnu.org/licenses/agpl-3.0.en.html)","readmeFilename":"README.md"}