{"id":18207639,"url":"https://github.com/crizmo/xlsx-mongo","last_synced_at":"2026-05-10T16:14:50.956Z","repository":{"id":179393706,"uuid":"663382719","full_name":"crizmo/xlsx-mongo","owner":"crizmo","description":"Streamlined Import, Export, and CRUD Operations between XLSX and MongoDB","archived":false,"fork":false,"pushed_at":"2023-07-22T13:33:48.000Z","size":84,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-16T21:27:08.722Z","etag":null,"topics":["add","crud","delete","excel","export","find","import","mongodb","update","xlsx"],"latest_commit_sha":null,"homepage":"https://xlsx-mongo.vercel.app/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crizmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-07T07:06:57.000Z","updated_at":"2025-10-16T16:14:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"6dbc0037-fc07-4e6c-84da-41f32881b592","html_url":"https://github.com/crizmo/xlsx-mongo","commit_stats":{"total_commits":50,"total_committers":1,"mean_commits":50.0,"dds":0.0,"last_synced_commit":"3e46fac5855e43a5f8fc3e2507b4fa56f796546d"},"previous_names":["crizmo/xlsx-mongo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crizmo/xlsx-mongo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crizmo%2Fxlsx-mongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crizmo%2Fxlsx-mongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crizmo%2Fxlsx-mongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crizmo%2Fxlsx-mongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crizmo","download_url":"https://codeload.github.com/crizmo/xlsx-mongo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crizmo%2Fxlsx-mongo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32862495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"ssl_error","status_checked_at":"2026-05-10T13:40:02.145Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["add","crud","delete","excel","export","find","import","mongodb","update","xlsx"],"created_at":"2024-11-03T13:03:47.263Z","updated_at":"2026-05-10T16:14:50.939Z","avatar_url":"https://github.com/crizmo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/crizmo/xlsx-mongo\"\u003e\n    \u003cimg src=\"https://cdn.discordapp.com/attachments/1126788880906080366/1126788914137546792/logo.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003eXLSX-Mongo\u003c/h3\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.npmjs.com/package/xlsx-mongo\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/xlsx-mongo.svg?maxAge=3600\u0026style=for-the-badge\" alt=\"NPM version\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/xlsx-mongo\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/xlsx-mongo?style=for-the-badge\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/xlsx-mongo\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/xlsx-mongo?style=for-the-badge\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    Streamlined Import, Export, and CRUD Operations between XLSX and MongoDB\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/crizmo/xlsx-mongo\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/crizmo/xlsx-mongo\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/crizmo/xlsx-mongo/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/crizmo/xlsx-mongo/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n    \n## About The Project\n\nSeamless Integration for Importing, Exporting, and Manipulating Data between XLSX and MongoDB. \u003cbr\u003e\n\n## Getting Started\n\n1. Make a mongodb database\n2. Copy the connection string of the database\n3. Paste the connection string in the .env file named `MONGO_URL`\n4. Check env_example file for more info - \u003ca href=\"https://github.com/crizmo/xlsx-mongo/blob/main/tests/.env_example\"\u003eenv_example\u003c/a\u003e\n5. Install the package \u003cbr\u003e\n   ```sh\n   npm install xlsx-mongo\n   ```\n6. Require the package in your main file \u003cbr\u003e\n```JS\nconst xlsxMongo = require('xlsx-mongo');\n```\n\n## Functions\n\nInit function is required to be run before any other function. \u003cbr\u003e\n```javascript\nxlsxMongo.init(filePath);\n```\n\nImport data from excel file to the specified mongodb collection. \u003cbr\u003e\n```javascript\nxlsxMongo.import(collectionName, showConsoleMessages);\n```\n\nExport data from the specified mongodb collection to excel file. \u003cbr\u003e\n```javascript\nconst exportFilePath = path.join(__dirname, 'Export.xlsx');\nxlsx2mongo.export(collectionName, exportFilePath, showConsoleMessages)\n```\n\nAdd data from excel file to the specified mongodb collection. \u003cbr\u003e\n```javascript\nxlsxMongo.add(collectionName, filePath, showConsoleMessages);\n```\n\nInsert data to the specified mongodb collection. \u003cbr\u003e\n```javascript\nconst insertData = { 'Name': 'Kurizu', 'Address': 'poopy' };\nxlsx2mongo.insert(collectionName, insertData, showConsoleMessages)\n```\n\nDelete data from the specified mongodb collection. \u003cbr\u003e\n```javascript\nxlsxMongo.delete(collectionName, showConsoleMessages);\n```\n\nUpdate data from the specified mongodb collection. \u003cbr\u003e\n```javascript\nxlsx2mongo.update(collectionName, updateCriteria, updateData, showConsoleMessages)\n```\n\nFind data from the specified mongodb collection. \u003cbr\u003e\n```javascript\nxlsx2mongo.find(collectionName, findCriteria, showConsoleMessages)\n```\n\nFind data with projection from the specified mongodb collection. \u003cbr\u003e\n```javascript\nconst findCriteriaPro = { 'Name': 'Kurizu' };\nconst projection = { 'Name': 1 };\nxlsx2mongo.findWithProjection(collectionName, findCriteriaPro, projection, showConsoleMessages)\n```\n\nReplace data with new excel file \u003cbr\u003e\n```javascript\nconst replaceFilePath = path.join(__dirname, 'Replace.xlsx');\nxlsx2mongo.replace(collectionName, replaceFilePath, showConsoleMessages)\n```\n\nCheck env_example file for more info - \u003ca href=\"https://github.com/crizmo/xlsx-mongo/blob/main/tests/test.js\"\u003eenv_example\u003c/a\u003e\n\n## Usage\n\n```javascript\nconst xlsx2mongo = require('xlsx-mongo');\nconst mongoose = require('mongoose');\nrequire('dotenv').config()\nconst path = require('path');\n\nconst filePath = path.join(__dirname, 'Test2.xlsx');\nconst showConsoleMessages = false;\n\nxlsx2mongo.init(filePath);\n\nconst collectionName = 'test';\n\nmongoose.connect(process.env.MONGO_URL, { useNewUrlParser: true, useUnifiedTopology: true })\n.then(async () =\u003e {\n    \n    // Import data from the Excel file to the specified collection\n    xlsx2mongo.import(collectionName, showConsoleMessages).then(() =\u003e {\n        mongoose.connection.close();\n    });\n\n    // // Add data from the Excel file to the specified collection\n    xlsx2mongo.add(collectionName, filePath, showConsoleMessages).then(() =\u003e {\n        mongoose.connection.close();\n    });\n\n    // Insert data to the specified collection\n    const insertData = { 'Name': 'Kurizu', 'Address': 'poopy' };\n    xlsx2mongo.insert(collectionName, insertData, showConsoleMessages).then(() =\u003e {\n        mongoose.connection.close();\n    });\n\n    // Export data from the specified collection to the Excel file\n    const exportFilePath = path.join(__dirname, 'Export.xlsx');\n    xlsx2mongo.export(collectionName, exportFilePath, showConsoleMessages).then(() =\u003e {\n      mongoose.connection.close();\n    });\n\n    // Delete data from the specified collection\n    xlsx2mongo.delete(collectionName, showConsoleMessages).then(() =\u003e {\n        mongoose.connection.close();\n    });\n\n    // Update data from the specified collection\n    //  to update single row\n    const updateCriteria = { 'Name': 'efrwdawd' };\n    const updateData = { $set: { 'Name': 'John Doe' } };\n    xlsx2mongo.update(collectionName, updateCriteria, updateData, showConsoleMessages).then(() =\u003e {\n        mongoose.connection.close();\n    }); \n\n    // to update multiple rows\n    const updateCriteriaMultiple = { 'Name': 'dwgdrthg', 'Address': 'grgdrgd' };\n    const updateDataMultiple = { $set: { 'Name': 'Kurizu', 'Address': 'poopy' } };\n    xlsx2mongo.update(collectionName, updateCriteriaMultiple, updateDataMultiple, showConsoleMessages).then(() =\u003e {\n        mongoose.connection.close();\n    });\n\n    // Find data from the specified collection\n    const findCriteria = { 'Name': 'Kurizu' };   \n    xlsx2mongo.find(collectionName, findCriteria, showConsoleMessages).then((res) =\u003e {\n        console.log(res);\n        mongoose.connection.close();\n    });\n\n    // Find data with projection\n    const findCriteriaPro = { 'Name': 'Kurizu' };\n    const projection = { 'Name': 1 };\n    xlsx2mongo.findWithProjection(collectionName, findCriteriaPro, projection, showConsoleMessages).then((res) =\u003e {\n        console.log(res);\n        mongoose.connection.close();\n    });\n\n    // Replace data with new excel file\n    const replaceFilePath = path.join(__dirname, 'Replace.xlsx');\n    xlsx2mongo.replace(collectionName, replaceFilePath, showConsoleMessages).then(() =\u003e {\n        mongoose.connection.close();\n    });\n\n    // Avoid running the above functions at the same time\n})\n.catch((err) =\u003e {\n    console.error('Error:', err);\n});\n```\n\n## For more information on how to use it visit\n\n- [Github](https://github.com/crizmo/xlsx-mongo)\n- [Example](https://github.com/crizmo/xlsx-mongo/tree/main/tests)\n\nIf you want me to add more functions or have any issues with the package, feel free to contact me on discord `kurizu.taz` or open an issue on github.\n\n## License\n\nDistributed under the MIT License. See `LICENSE.txt` for more information.\n\n## Contact\nPackage Made by: `kurizu.taz` on discord \u003cbr\u003e\nGithub - [https://github.com/crizmo/xlsx-mongo](https://github.com/crizmo/xlsx-mongo)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrizmo%2Fxlsx-mongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrizmo%2Fxlsx-mongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrizmo%2Fxlsx-mongo/lists"}