{"id":15007546,"url":"https://github.com/vladinator/excel-datamashup","last_synced_at":"2026-01-05T10:04:06.449Z","repository":{"id":247792177,"uuid":"826746901","full_name":"Vladinator/excel-datamashup","owner":"Vladinator","description":"Read and edit the Power Query formula in Excel documents.","archived":false,"fork":false,"pushed_at":"2024-09-24T08:09:20.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T08:32:22.273Z","etag":null,"topics":["excel","nodejs","npmjs","powerquery"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vladinator.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":"2024-07-10T09:46:58.000Z","updated_at":"2024-09-24T08:09:24.000Z","dependencies_parsed_at":"2024-07-12T21:15:21.791Z","dependency_job_id":null,"html_url":"https://github.com/Vladinator/excel-datamashup","commit_stats":null,"previous_names":["vladinator/excel-datamashup"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladinator%2Fexcel-datamashup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladinator%2Fexcel-datamashup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladinator%2Fexcel-datamashup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladinator%2Fexcel-datamashup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vladinator","download_url":"https://codeload.github.com/Vladinator/excel-datamashup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238968337,"owners_count":19560586,"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":["excel","nodejs","npmjs","powerquery"],"created_at":"2024-09-24T19:11:13.367Z","updated_at":"2025-10-30T12:31:31.119Z","avatar_url":"https://github.com/Vladinator.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# excel-datamashup\n\nThis sample project contains code to convert a Excel customXml item1.xml file into a usable data structure.\n\nThe various Excel formats `xlsx`, `xlsm`, `xlsb` are ZIP based and thus can be extracted.\n\nThe contents will in situations where Power Query is used, contain a customXml folder with a item1.xml file that contains the relevant data structure in binary format.\n\nThis binary format can be processed into something we can read, edit, then re-package back into binary format.\n\nThe goal of this project is to faciliate processing a Excel file, then being able to edit and save it in both browser and terminal modes.\n\n## API\n\n\u003cdetails\u003e\n  \u003csummary\u003eDirectly editing `customXml\\item1.xml` (DataMashup) using `ExcelCustomXml`.\u003c/summary\u003e\n\n```ts\nimport { type UnzippedItem, ExcelCustomXml } from 'excel-datamashup';\n\nconst xml: string = '...';\n\n// returns a working instance of the class\nconst excelXml: ExcelCustomXml = await ExcelCustomXml.create(xml);\n\n// find the power query file\nconst powerQuery: UnzippedItem | undefined = excelXml.datamashup.rootItems.find(\n    (o) =\u003e o.path.endsWith('Section1.m')\n);\n\n// if found, set its contents to something else\nif (powerQuery) {\n    excelXml.datamashup.setFileContents(powerQuery, '...');\n\n    // always reset permissions when editing\n    await excelXml.datamashup.resetPermissions();\n}\n\n// pack the data back to a xml string, then write it back to the `customXml\\item1.xml` file using your favorite zip editing library\nconst newXml: string | undefined = await excelXml.pack();\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eEditing an Excel xlsx file using `ExcelZip`.\u003c/summary\u003e\n\n```ts\nimport { type Result, ExcelZip, UnzippedItem } from 'excel-datamashup';\n\n// read and store the binary zip data as number array or Uint8Array\nconst zip = new Uint8Array();\n\n// process the zip into a more manageable object\nconst excelZip: ExcelZip = await ExcelZip.unzip(zip);\n\n// get the power query contents\nconst powerQuery: UnzippedItem | undefined = await excelZip.getPowerQueryFile();\n\n// modify the power query contents\nif (powerQuery) {\n    await excelZip.setPowerQueryFile(\n        powerQuery,\n        'section Section1;\\n\\nshared Test = let\\r\\n    result = #table(1, {{\"This is an example.\"}})\\r\\nin\\r\\n    result;'\n    );\n}\n\n// zip the contents back to an Excel file\nconst result: Result\u003cUint8Array\u003e = await excelZip.zip();\n\n// evaluate if it was successfull\nif (result.ok) {\n    console.log('Save the xlsx file:', result.data.length);\n} else {\n    console.log('Unable to create xlsx file.');\n}\n```\n\n\u003c/details\u003e\n\n## Sample\n\nThe sample folder contain an example file that contains a Power Query, along with some additional sample code.\n\n## Resources\n\n-   https://bengribaudo.com/blog/2020/04/22/5198/data-mashup-binary-stream\n-   https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-qdeff/27b1dd1e-7de8-45d9-9c84-dfcc7a802e37\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladinator%2Fexcel-datamashup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvladinator%2Fexcel-datamashup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladinator%2Fexcel-datamashup/lists"}