{"id":44441614,"url":"https://github.com/leoreisdias/excel-ent","last_synced_at":"2026-02-12T14:46:55.533Z","repository":{"id":57132396,"uuid":"390494103","full_name":"leoreisdias/excel-ent","owner":"leoreisdias","description":"The purpose of this lib is to help you export data in Excel and CSV.","archived":false,"fork":false,"pushed_at":"2024-02-24T05:24:18.000Z","size":171,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-19T19:40:00.067Z","etag":null,"topics":["csv-export","excel-export","export-to-excel","exports"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/excel-ent","language":"TypeScript","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/leoreisdias.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}},"created_at":"2021-07-28T20:24:17.000Z","updated_at":"2023-10-06T23:30:57.000Z","dependencies_parsed_at":"2023-02-01T02:45:14.750Z","dependency_job_id":null,"html_url":"https://github.com/leoreisdias/excel-ent","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/leoreisdias/excel-ent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoreisdias%2Fexcel-ent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoreisdias%2Fexcel-ent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoreisdias%2Fexcel-ent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoreisdias%2Fexcel-ent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leoreisdias","download_url":"https://codeload.github.com/leoreisdias/excel-ent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoreisdias%2Fexcel-ent/sbom","scorecard":{"id":585252,"data":{"date":"2025-08-11","repo":{"name":"github.com/leoreisdias/excel-ent","commit":"86b2c5b9d87d44638315c45d3700396f6bf682bf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/leoreisdias/excel-ent/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/leoreisdias/excel-ent/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/leoreisdias/excel-ent/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/leoreisdias/excel-ent/publish.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/publish.yml:36","Warn: npmCommand not pinned by hash: .github/workflows/publish.yml:58","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   4 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T20:18:24.153Z","repository_id":57132396,"created_at":"2025-08-20T20:18:24.153Z","updated_at":"2025-08-20T20:18:24.153Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29369074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: 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":["csv-export","excel-export","export-to-excel","exports"],"created_at":"2026-02-12T14:46:53.639Z","updated_at":"2026-02-12T14:46:55.518Z","avatar_url":"https://github.com/leoreisdias.png","language":"TypeScript","readme":"# Excel-ent\n\n[![NPM](https://img.shields.io/npm/v/excel-ent)](https://www.npmjs.com/package/excel-ent)\n[![npm](https://img.shields.io/npm/l/excel-ent)](https://github.com/leoreisdias/excel-ent/blob/main/LICENSE)\n\n#### PT-BR Documentation: [Notion - Excel-ent PT-BR](https://leord.notion.site/Excel-ent-Documenta-o-PT-BR-6b12e6d92d554b08b467b8ee17c1286c?pvs=4)\n\n# Sumário\n\n- [Description](#description)\n- [Installation](#installation)\n- [Using excel-ent](#using-excel-ent)\n  - [exportmeExcel](#exportmeexcel)\n    - [Parameters](#parameters)\n    - [Example](#example)\n  - [exportmeToCsv](#exportmetocsv)\n    - [Parameters](#parameters-1)\n    - [Example](#example-1)\n  - [exportmeExcelAdvanced](#exportmeexceladvanced)\n    - [Parameters](#parameters-2)\n    - [Understanding `exportmeExcelAdvanced` exclusive props](#exportmeexceladvanced-exclusive-props)\n      - [`merges`](#merges)\n      - [`loggingMatrix`](#loggingmatrix)\n      - [the `data` property](#exportmeexceladvanced-the-data-property)\n    - [About `ExcelEntContent`](#about-excelentcontent)\n      - [Example](#example-2)\n- [Types](#types)\n- [License](#license)\n- [Acknowledgments](#acknowledgments)\n\n### Version 4\n\n\u003cimg src=\"https://i.pinimg.com/originals/56/b7/64/56b7642388e52d62910a8806a18e10be.gif\" alt=\"Above version 4 - Gear Fourth\" width=\"160\" height=\"100\"\u003e\n\n## Description\n\n[excel-ent](https://github.com/leoreisdias/excel-ent.git) is a helper library that simplifies exporting data to XLSX and CSV using the SheetJS CE library. Now it can be used in **client browsers** and **backend servers**.\n\n## Installation\n\n```bash\n$ yarn add excel-ent\n\n# or with npm\n\n$ npm install excel-ent --save\n```\n\n## Using excel-ent\n\nExcel-ent provides three main functions for exporting data: `exportmeExcel`, `exportmeToCsv` and `exportmeExcelAdvanced`.\n\n### exportmeExcel\n\n```ts\nexportmeExcel({\n  data: Record\u003cstring, any\u003e[] | PaginatedObjectContentProps[],\n  fileName: string,\n  exportAs: {\n    type: 'buffer' | 'base64' | 'download' | 'filepath';\n    path?: string; // Required if exportAs type is 'filepath'\n  },\n  options?: {\n    headerStyle?: XLSX.CellStyle;\n    bodyStyle?: XLSX.CellStyle;\n    columnWidths?: number[];\n    rowHeights?: number[];\n    globalRowHeight?: number;\n    sheetProps?: XLSX.FullProperties;\n    stripedRows?: boolean;\n  }\n})\n```\n\n#### Parameters\n\n- `data`: Required, must be an array of objects or `PaginatedObjectContentProps` _(if you need multiple worksheet tabs)_.\n- `fileName`: Required, the name of the generated file.\n- `options`: Optional, receives the following attributes:\n  - `headerStyle` and `bodyStyle`: Both receive styles in the format of XLSX.CellStyle. You can check the available options [here in the xlsx-js-style](https://github.com/gitbrent/xlsx-js-style#cell-style-properties)\n  - `columnWidths`: An array of numeric values indicating the minimum width for each column.\n  - `rowHeights`: An array of numeric values indicating the minimum height for each row.\n  - `globalRowHeight`: A numeric value that sets a minimum height for ALL rows in the matrix.\n  - `sheetProps`: Additional properties for the worksheet, following XLSX.FullProperties. You can check the [official docs for more details...](https://docs.sheetjs.com/docs/csf/book#file-properties)\n  - `stripedRows`: Optional, alternates row colors between white (customizable via cell styling) and light gray (F2F2F2) to improve data readability.\n- `exportAs`: An object specifying how to export the file, with a type attribute that can be 'buffer', 'base64', 'download', or 'filepath'. If 'filepath' is chosen, the path attribute becomes required.\n\n#### Data Prop\n\nAs mentioned above, it can be an array of objects like:\n\n```json\n[\n  {\n    \"name\": \"test\",\n    \"age\": 20\n  }\n]\n```\n\nThis will generate a sheet with \"name\" and \"age\" as headers with its contents.\n\n#### Data prop for multiple worksheet tabs\n\nIf you want to have multiple tabs in your resulted XLS, the **\"data\"** prop can also be an array of `PaginatedObjectContentProps`, in it we have a **\"content\"** prop and a **\"sheetName\"** prop:\n\n```json\n[\n  {\n    \"content\": [\n      {\n        \"name\": \"Test\",\n        \"age\": 20\n      }\n    ],\n    \"sheetName\": \"User\"\n  },\n  {\n    \"content\": [\n      {\n        \"task\": \"WTF?\",\n        \"score\": 0\n      }\n    ],\n    \"sheetName\": \"Questions\"\n  }\n]\n```\n\nIn this example, each **\"content\"** will be placed in a different sheet tab with the specified name in **\"sheetName\"**.\n\n#### Example\n\n```ts\nimport { exportmeExcel } from \"excel-ent\";\n\nconst data = [\n  {\n    id: 1,\n    name: \"Some Name\",\n    age: 21,\n  },\n  {\n    id: 2,\n    name: \"Some New Name\",\n    age: 23,\n  },\n  {\n    id: 3,\n    name: \"Some Name Again\",\n    age: 22,\n  },\n];\n\nexportmeExcel({\n  data,\n  fileName: \"Test File\",\n  exportAs: {\n    type: \"download\",\n  },\n  options: {\n    columnWidths: [30, 30, 30], // Each of 3 rows width\n    globalRowHeight: 20, // Height for ALL rows\n    headerStyle: {\n      fill: {\n        fgColor: {\n          rgb: \"0a1c3e\", // Color can't have the '#'\n        },\n      },\n      font: {\n        bold: true,\n        color: {\n          rgb: \"ffffff\", // Must have at least 6 letters (FFF wouldn't work)\n        },\n      },\n      alignment: {\n        vertical: \"center\",\n        horizontal: \"center\",\n      },\n    },\n    bodyStyle: {\n      font: {\n        name: \"sans-serif\",\n      },\n      alignment: {\n        vertical: \"center\",\n        horizontal: \"center\",\n      },\n    },\n    stripedRows: true,\n  },\n});\n```\n\nOutput\n\n![Example output](https://i.imgur.com/kqn1oZn.png)\n\n---\n\n### exportmeToCsv\n\n`exportmeToCsv(data: any[], title: string)`\n\n#### Parameters\n\n- `data`: Required, must be an array of objects.\n- `title`: Required, the name of the generated CSV file.\n\n#### Example\n\n```ts\nimport { exportmeToCsv } from \"excel-ent\";\n\nconst data = [\n  {\n    id: 1,\n    name: \"Some Name\",\n    age: 21,\n  },\n  {\n    id: 2,\n    name: \"Some New Name\",\n    age: 23,\n  },\n  {\n    id: 3,\n    name: \"Some Name Again\",\n    age: 22,\n  },\n];\n\nexportmeToCsv(data, \"MyReport\");\n```\n\n### exportmeExcelAdvanced\n\n```ts\nexportmeExcelAdvanced(options: {\n  data: ExcelMeDataProps;\n  exportAs: ExportationType;\n  merges?: MergeProps[];\n  options?: ExportMeExcelOptions;\n  loggingMatrix?: boolean;\n  fileName: string;\n  options?: {\n    headerStyle?: XLSX.CellStyle;\n    bodyStyle?: XLSX.CellStyle;\n    columnWidths?: number[];\n    rowHeights?: number[];\n    globalRowHeight?: number;\n    sheetProps?: XLSX.FullProperties;\n  };\n})\n```\n\n#### Parameters\n\n- `fileName`: Required, the name of the generated file.\n- `options`: Optional, receives the following attributes:\n  - `headerStyle` and `bodyStyle`: Both receive styles in the format of XLSX.CellStyle. You can check the available options [here in the xlsx-js-style](https://github.com/gitbrent/xlsx-js-style#cell-style-properties)\n  - `columnWidths`: An array of numeric values indicating the minimum width for each column.\n  - `rowHeights`: An array of numeric values indicating the minimum height for each row.\n  - `globalRowHeight`: A numeric value that sets a minimum height for ALL rows in the matrix.\n  - `sheetProps`: Additional properties for the worksheet, following XLSX.FullProperties. You can check the [official docs for more details...](https://docs.sheetjs.com/docs/csf/book#file-properties)\n- `exportAs`: An object specifying how to export the file, with a type attribute that can be 'buffer', 'base64', 'download', or 'filepath'. If 'filepath' is chosen, the path attribute becomes required.\n- `merges`: Optional, merges cells within the worksheet based on specified start and end coordinates.\n  `loggingMatrix`: Optional, logs the resulting matrix before export for debugging purposes.\n- `data`: Required, defines the data structure.\n\n### `exportmeExcelAdvanced` exclusive props\n\n#### `merges`\n\nThe merges property is an optional attribute that can be used with the `exportmeExcelAdvanced` function in the Excel-ent library. It accepts an array of MergeProps, where each MergeProps object defines the starting and ending coordinates (row and column) for merging cells within the worksheet.\n\n    Default Value: None (No cell merging by default).\n    Usage: By providing an array of MergeProps, you can merge specific cells in the worksheet, improving the visual organization of data.\n\nUsage example\n\n```ts\nimport { exportmeExcelAdvanced } from \"excel-ent\";\n\nconst merges = [\n  { start: { row: 1, column: 1 }, end: { row: 1, column: 3 } }, // Merge cells in the first row from column 1 to 3\n  { start: { row: 2, column: 2 }, end: { row: 3, column: 2 } }, // Merge cells in the second and third rows in column 2\n];\n\nreturn exportmeExcelAdvanced({\n  fileName: `MergedCellsData`,\n  options: {\n    ...other,\n    merges: merges, // Merge specified cells\n  },\n  // ... (other configurations)\n});\n```\n\n#### `loggingMatrix`\n\nWhen set to true, it enables the logging of the resulting matrix in the browser or server log just before exporting. This feature is designed to assist in debugging and understanding the data structure that will be used for export.\n\n    Default Value: Disabled (false).\n    Usage: By configuring loggingMatrix as true, you can view the matrix content in the log, which can be helpful for debugging and troubleshooting any issues related to data formatting or structure.\n\n---\n\n#### `exportmeExcelAdvanced`: the `data` property\n\nThe \"data\" property is a fundamental aspect of the Excel-ent library, and it plays a pivotal role in configuring the content structure of the worksheet to be exported. It is strongly typed using the `ExcelEntDataProps` interface.\n\n`ExcelEntDataProps`:\n\n- `headerRow` (Optional): An array of `ExcelEntContent`, which can be of type ExcelEntCellObject (as previously documented), or a number, string, null, or undefined.\n- `contentStructure`: Determines the content structure within the worksheet and can be one of the following values: **\"rows\"**, **\"columns\"** or **\"mixed.\"**\n\n**Content Structure**:\nThe \"content\" property varies based on the selected \"contentStructure.\"\n\nWhen `contentStructure` is \"rows\":\n\n- `content` is a matrix of `ExcelEntContent`. Each element can be an `ExcelEntCellObject`, number, string, null, or undefined. In this structure, each row in the content matrix corresponds to a row in the worksheet.\n\nExample:\n\n```ts\ndata: {\n  contentStructure: \"rows\",\n  headerRow: ['ID', 'Name', 'Age'],\n  content: [\n    [1, 'John'],\n    [2,, 28],\n    [3, 'Bob', 35],\n  ],\n}\n```\n\nResulting Matrix and Excel structure:\n\n```ts\n[\n  [\"ID\", \"Name\", \"Age\"],\n  [1, \"John\"],\n  [2, , 28], // null or undefined values result in empty cells\n  [3, \"Bob\", 35],\n];\n```\n\nWhen `contentStructure` is \"columns\":\n\n- `content` is a matrix of `ExcelEntContent`. Each element can be an `ExcelEntCellObject`, number, string, null, or undefined. In this structure, the Excel-ent library will transform the column matrix into a row matrix by taking the transpose of the original matrix. Each column in the content matrix corresponds to a column in the worksheet.\n\nExample:\n\n```ts\ndata: {\n  contentStructure: \"columns\",\n  headerRow: ['ID', 'Name', 'Age'],\n  content: [\n    [1, 2, 3],\n    ['John', 'Alice', 'Bob'],\n    [30, 28, 35],\n  ],\n}\n```\n\nResulting Matrix (Transpose of the Original Matrix) and Excel structure:\n\n```ts\n[\n  [\"ID\", \"Name\", \"Age\"],\n  [1, \"John\", 30],\n  [2, \"Alice\", 28],\n  [3, \"Bob\", 35],\n];\n```\n\nWhen contentStructure is \"mixed\":\n\n- `content` is an array of `MixedContent` objects. Each `MixedContent` object represents either a row or a column in the matrix, specified by the `type` attribute.\n  - When `type` is **\"row\"**: The array in the `value` attribute will be directly incorporated into the matrix as a row, without any additional processing.\n  - When `type` is **\"column\"**: The array in the `value` attribute will represent a column in the sheet. During exportation the code will group all consecutive \"column\" types in the value attribute until the next \"row\" type is encountered. It will then transform this group of columns into a group of rows, resulting in a transposed structure, and this transformed structure will be inserted in the final matrix.\n\nExample:\n\n```ts\ndata: {\n  contentStructure: \"mixed\",\n  content: [\n    {\n      type: 'row',\n      value: ['ID', 'Name', 'Age'],\n    },\n    {\n      type: 'column',\n      value: [1, 2, 3],\n    },\n    {\n      type: 'column',\n      value: ['John', 'Alice', 'Bob'],\n    },\n    {\n      type: 'column',\n      value: [30, 28, 35],\n    },\n    {\n      type: 'row',\n      value: ['some cell'],\n    },\n  ],\n}\n```\n\nResulting Matrix and Excel structure:\n\n```ts\n[\n  [\"ID\", \"Name\", \"Age\"],\n  [1, \"John\", 30],\n  [2, \"Alice\", 28],\n  [3, \"Bob\", 35],\n  [\"some cell\", ,],\n];\n```\n\nIn the \"mixed\" content structure, you can specify whether each element represents a row or a column, allowing for flexible data organization. The Excel-ent library will handle the transformation accordingly.\n\nThe \"data\" property is central to configuring the content structure of your worksheet, offering flexibility in how you structure your data for export.\n\n---\n\n#### About `ExcelEntContent`\n\nThe \"ExcelEntContent\" type is used to define the content of individual cells in the Excel worksheet. It can take on various forms, including numbers, strings, null, undefined, or an object of type \"ExcelEntCellObject.\"\n\nThe `ExcelEntCellObject` type is as follows:\n\n```ts\ntype BooleanCell = {\n  type: \"boolean\";\n  value: boolean;\n};\n\ntype StringCell = {\n  type: \"string\";\n  value: string;\n};\n\ntype NumberCell = {\n  type: \"number\";\n  value: number;\n  formatted?: string;\n  mask?: string;\n};\n\ntype DateCell = {\n  type: \"date\";\n  value: Date | string;\n  formatted?: string;\n  mask?: string;\n};\n\ntype Cell = {\n  formula?: string;\n  formulaRange?: `${string}:${string}`;\n  hyperlink?: {\n    target: string;\n    tooltip?: string;\n  };\n  comment?: {\n    author: string;\n    text: string;\n  }[];\n  style?: XLSX.CellStyle;\n};\n\nexport type ExcelEntCellObject = Cell \u0026\n  (BooleanCell | StringCell | NumberCell | DateCell);\n```\n\n#### Example\n\nHere's an example of how to use `exportmeExcelAdvanced`:\n\n```ts\nimport { exportmeExcelAdvanced } from \"excel-ent\";\n\nconst data = [\n  {\n    id: 1,\n    name: \"John\",\n    age: 30,\n  },\n  {\n    id: 2,\n    name: \"Alice\",\n    age: 28,\n  },\n  {\n    id: 3,\n    name: \"Bob\",\n    age: 35,\n  },\n];\n\nconst content: ExcelEntContent[][] = data.map(\n  (item, index) =\u003e\n    [\n      item.id,\n      {\n        type: \"string\",\n        value: item.name,\n        style: {\n          fill: {\n            bgColor: {\n              rgb: \"FFFF00\",\n            },\n          },\n        },\n      },\n      {\n        type: \"number\",\n        value: item.value,\n        formatted: `${item.value} years`,\n        comment: [\n          {\n            author: \"User\",\n            text: \"This is a comment\",\n          },\n        ],\n      },\n    ] as ExcelEntContent[]\n);\n\nreturn exportmeExcelAdvanced({\n  fileName: `Example`,\n  options: {\n    headerStyle: {\n      font: {\n        sz: 40,\n      },\n    },\n    bodyStyle: {\n      font: {\n        sz: 16,\n      },\n    },\n    sheetProps: {\n      Title: `Additional Info`,\n    },\n  },\n  data: {\n    contentStructure: \"column\",\n    headerRow: [\"ID\", \"Name\", \"Age\"],\n    content: content,\n  },\n  exportAs: {\n    type: \"buffer\",\n  },\n});\n```\n\n---\n\n### Types\n\nYou can import the Excel-ent types to assist in usage and preparation.\n\n[XLSX.CellStyles properties can be found here.](https://github.com/gitbrent/xlsx-js-style#cell-style-properties)\n\n## License\n\nexcel-ent is [MIT licensed](LICENSE).\n\n---\n\n## Acknowledgments\n\nSpecial thanks to the following libraries for their invaluable contributions:\n\n- [SheetJS CE](https://github.com/SheetJS/sheetjs): A fundamental framework that serves as the backbone for Excel-ent, providing powerful export functionality and a wide range of features.\n\n- [xlsx-js-style](https://github.com/gitbrent/xlsx-js-style): This library played a pivotal role in enabling us to seamlessly incorporate styling and formatting options into Excel-ent.\n\n### Thank you and be free to contribute 🚀\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleoreisdias%2Fexcel-ent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleoreisdias%2Fexcel-ent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleoreisdias%2Fexcel-ent/lists"}