{"id":16759058,"url":"https://github.com/hardeep-bit/xlconverter","last_synced_at":"2025-07-19T22:05:58.008Z","repository":{"id":57401640,"uuid":"94141775","full_name":"hardeep-bit/xlconverter","owner":"hardeep-bit","description":"Convert Excel File to Objects","archived":false,"fork":false,"pushed_at":"2018-03-05T14:13:00.000Z","size":17,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-23T01:04:51.450Z","etag":null,"topics":["converter","filepath","getcoloumn","getrow","getters","perticular-columns","query","sheet"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hardeep-bit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-12T21:23:32.000Z","updated_at":"2020-08-18T10:13:40.000Z","dependencies_parsed_at":"2022-09-15T18:31:49.114Z","dependency_job_id":null,"html_url":"https://github.com/hardeep-bit/xlconverter","commit_stats":null,"previous_names":["hardeep-bit/xlconverter","hardy12994/xlconverter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hardeep-bit/xlconverter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardeep-bit%2Fxlconverter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardeep-bit%2Fxlconverter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardeep-bit%2Fxlconverter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardeep-bit%2Fxlconverter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hardeep-bit","download_url":"https://codeload.github.com/hardeep-bit/xlconverter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardeep-bit%2Fxlconverter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266026342,"owners_count":23866033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["converter","filepath","getcoloumn","getrow","getters","perticular-columns","query","sheet"],"created_at":"2024-10-13T04:07:08.234Z","updated_at":"2025-07-19T22:05:57.121Z","avatar_url":"https://github.com/hardeep-bit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":" Nowdays everything is easly maintain if we are dealing with objects .As I have face many problems while in uploading excel file ,taking data from excel and play with each Cell of excel file .This Converter is just a interface which helps to get objects from excel Or excel from objects.\n\n \n link  https://github.com/hardy12994/xlconverter\n \n Here are the two Converters and Some Getters (define below) present in it :\n\n- Excel to Objects\n- Objects to Excel\n\n### Excel to Objects\n   \n   ```sh\n\n   let xlconverter = require('xlconverter');\n\n    let path=\"abv/cac/ac/ac.xlsx\";\n    let sheet=\"sheet1\";\n\n\n    // xlToObjects, will provide objects of all the sheets present in xl sheet;\n\n     xlconverter.xlToObjects(path, function (err, data) {\n         console.log(err);\n         console.log(data);\n     });\n\n\n    /**\n    * data-\n    *\n    * [{},{},{}]\n    * // object as rows\n    */\n\n\n    // xlToObjectsOfSheet, will provide objects of perticular sheet present in xl sheet;\n\n     xlconverter.xlToObjectsOfSheet(path, sheet, function (err, data) {\n         console.log(err);\n         console.log(data);\n     });\n\n      /**\n      * data -\n      * {\n      *   sheet1: [{},{},{}],\n      *   sheet2: [{},{},{}]\n      * }\n      * // object as rows\n      */\n     \n\n   ```\n\n### Objects to Excel\n\n```sh\n\n     let headers=[\"name\",\"age\"];\n     let rows=[{ name:\"hardy\",age:21 },{ name:\"hardy\",age:21 }];\n     let path=\"abc/cac/\";\n     let fileName=\"myNewSheet\"; //.xlsx is by default\n     let sheetName=\"sheet1\";\n\n     xlconverter.objectsToXl(headers, rows, path, fileName, sheetName, function (err, data) {\n         console.log(err);\n         console.log(data); \n     });\n\n      /**\n      * if error -`sheetName` sheet not created\n      * data -\n      * `sheetName` sheet successfully created.\n      */\n\n```\n\n## Getters\n\nWe can use Excel Sheet as a very small Database as we can do\nExtractions from that by putting some queries,\nThe query can be made in form of Objects, Arrays\n Thing can be achive like:\n- Any Perticular Row.\n- Any Perticular Column.\n- Get Number of Rows.\n- Get Number of Columns.\n- Get Data as Objects of Perticular Columns.\n\n### Get Row\n\n- Accept Query as Object Eg- `{name:\"Jhon\",age:\"21\"}`.\n- `and` type of query will be done.\n- Return Single Row which matches both Conditions `First`.\n\n```sh\n\n     let rowQuery= {name:\"Jhon\",age:\"21\"};\n     let filePath=\"abc/cac/\";\n     let sheetName=\"sheet1\";\n     \n     xlconverter.getters.row(filePath, rowQuery, sheetName, function (err, data) {\n         console.log(err);\n         console.log(data); \n     });\n\n    /**\n    * data-\n    *\n    * {name:\"Jhon\", age:\"21\", f_name:\"D_Jhon\"}\n    * // object as rows\n    */\n\n\n```\n\n\n### Get Rows\n- Accept Parameters as Object Eg- `{name:\"Jhon\",age:\"21\"}`.\n- `and` type of query will be done.\n- Return Multiple Rows which matches both Conditions.\n\n\n```sh\n\n     let rowQuery= {name:\"Jhon\",age:\"21\"};\n     let filePath=\"abc/cac/\";\n     let sheetName=\"sheet1\";\n     \n     xlconverter.getters.rows(filePath, rowQuery, sheetName, function (err, data) {\n         console.log(err);\n         console.log(data); \n     });\n\n    /**\n    * data-\n    *\n    * [{name:\"Jhon\", age:\"21\", f_name:\"D_Jhon\"},\n    * {name:\"Jhon\", age:\"21\", f_name:\"D_Jhonee\"}]\n    * // object as rows\n    */\n\n```\n\n\n### Get Column\n- Accept Parameters as String Eg- `\"name\"`.\n- Return Array of Strings which is Present in that Column.\n\n\n```sh\n\n     let colQuery= \"name\";\n     let filePath=\"abc/cac/\";\n     let sheetName=\"sheet1\";\n     \n     xlconverter.getters.coloumn(filePath, colQuery, sheetName, function (err, data) {\n         console.log(err);\n         console.log(data); \n     });\n\n    /**\n    * data-\n    *\n    * [\"Jhon\",\"Jhon2\",\"Jhon3\"]\n    * // as coloumn cells\n    */\n\n```\n\n\n### Get Columns\n- Accept Parameters as String in Array Eg- `[\"name\",\"age\"]`.\n- Return Object with Keys name and age and both of them have Array\n of Strings which is Present in respective Column.\n\n\n```sh\n\n     let colQuery= [\"name\",\"age\"];\n     let filePath=\"abc/cac/\";\n     let sheetName=\"sheet1\";\n     \n     xlconverter.getters.coloumns(filePath, colQuery, sheetName, function (err, data) {\n         console.log(err);\n         console.log(data); \n     });\n\n    /**\n    * data-\n    *\n    * {\n    *  name:[\"Jhon\",\"Jhon2\",\"Jhon3\"],\n    *  age:[21,33,13]\n    * }\n    * // as coloumn cells\n    */\n\n```\n\n\n### Get Rows from Selective Columns\n- Accept Parameters as String in Array Eg- `[\"name\",\"age\"]`.\n- Return all Rows with Selected Columns name and age as Objects in Array\n- Getting Selective Coloumns of Rows. \n\n```sh\n\n     let colQuery= [\"name\",\"age\"];\n     let filePath=\"abc/cac/\";\n     let sheetName=\"sheet1\";\n     \n     xlconverter.getters.selectiveColoumnsOfRows(filePath, colQuery, sheetName, function (err, data) {\n         console.log(err);\n         console.log(data); \n     });\n\n    /**\n    * data-\n    *\n    * [\n    *   {name: \"hardy\", age: 12},\n    *   {name: \"pery\", age: 41},\n    *   {name: \"bob\", age: 42}\n    *  ]\n    * // \n    */\n\n```\n\n**N O T E** :\n- `callback` function is required in all methods.\n- `getters` are using `xlToObjectsOfSheet` function that's why sheet name is required.\n\n**Contributions are most wellcome**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardeep-bit%2Fxlconverter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhardeep-bit%2Fxlconverter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardeep-bit%2Fxlconverter/lists"}