{"id":15036597,"url":"https://github.com/jmaister/excellentexport","last_synced_at":"2025-05-13T19:13:54.744Z","repository":{"id":12112578,"uuid":"14702145","full_name":"jmaister/excellentexport","owner":"jmaister","description":"Javascript export to Excel","archived":false,"fork":false,"pushed_at":"2025-01-29T23:12:33.000Z","size":5625,"stargazers_count":1446,"open_issues_count":4,"forks_count":307,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-04-28T01:18:17.010Z","etag":null,"topics":["csv","csv-export","excel","export","export-excel","hacktoberfest","javascript","javascript-export"],"latest_commit_sha":null,"homepage":"","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/jmaister.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","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},"funding":{"github":"jmaister"}},"created_at":"2013-11-25T23:52:01.000Z","updated_at":"2025-04-23T12:21:00.000Z","dependencies_parsed_at":"2022-07-09T16:46:51.110Z","dependency_job_id":"71f3dc5c-4cb4-4f0c-96d5-dd07b89cfa30","html_url":"https://github.com/jmaister/excellentexport","commit_stats":{"total_commits":194,"total_committers":17,"mean_commits":"11.411764705882353","dds":0.2628865979381443,"last_synced_commit":"c2ac7e115b85724ceffa174e19421813bda6b642"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmaister%2Fexcellentexport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmaister%2Fexcellentexport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmaister%2Fexcellentexport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmaister%2Fexcellentexport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmaister","download_url":"https://codeload.github.com/jmaister/excellentexport/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254010813,"owners_count":21998995,"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":["csv","csv-export","excel","export","export-excel","hacktoberfest","javascript","javascript-export"],"created_at":"2024-09-24T20:31:39.343Z","updated_at":"2025-05-13T19:13:54.725Z","avatar_url":"https://github.com/jmaister.png","language":"TypeScript","funding_links":["https://github.com/sponsors/jmaister"],"categories":["TypeScript"],"sub_categories":[],"readme":"\r\n[![Node CI](https://github.com/jmaister/excellentexport/actions/workflows/webpack.yml/badge.svg?branch=master)](https://github.com/jmaister/excellentexport/actions/workflows/webpack.yml)\r\n[![](https://data.jsdelivr.com/v1/package/npm/excellentexport/badge)](https://www.jsdelivr.com/package/npm/excellentexport)\r\n[![codecov](https://codecov.io/gh/jmaister/excellentexport/graph/badge.svg?token=CMhCN0GnmY)](https://codecov.io/gh/jmaister/excellentexport)\r\n\r\n# ExcellentExport.js\r\n\r\n - [:heart: Sponsor ExcellentExport.js project:heart:](https://github.com/sponsors/jmaister)\r\n\r\n - JavaScript export to Excel or CSV.\r\n\r\n - A quick JavaScript library to create export to Excel/CSV from HTML tables in the browser. No server required.\r\n\r\n - As part of the new version 3.0.0+, there is support for _XLSX_. The drawback is that the library is 200+ KB.\r\n\r\n - Check My Blog Page for Testing :\r\n      [JavaScript export to Excel](http://jordiburgos.com/post/2013/javascript-export-to-excel.html)\r\n\r\n      [ExcellentExport.js update: JavaScript export to Excel and CSV](http://jordiburgos.com/post/2017/excellentexport-javascript-export-to-excel-csv.html)\r\n\r\n# Revision history:\r\n\r\n### 3.9.9\r\n\r\n* Configure codecov to track code coverage.\r\n* Removed coveralls, the library used is too old, not updated in years and has many vulnerabilities.\r\n* Remove unused dependencies (there was a lot of them).\r\n\r\n### 3.9.8\r\n\r\n* _Update npm dependencies to fix vulnerabilities_\r\n* Moving to npm build (package-lock.json), yarn does not support \"audit fix\" command to fix dependencies vulnerabilities automatically.\r\n\r\n### 3.9.7\r\n\r\n* _Update npm dependencies to fix vulnerabilities_\r\n* xlsx package loaded from CDN [SheetJS CDN](https://cdn.sheetjs.com/)\r\n\r\n### 3.9.6\r\n\r\n* Remove references to openbase.io\r\n* Fix typos\r\n* _Update npm dependencies to fix vulnerabilities_\r\n\r\n### 3.9.5\r\n\r\n* _Update npm dependencies to fix vulnerabilities_\r\n\r\n### 3.9.4\r\n\r\n* _Update npm dependencies to fix vulnerabilities_\r\n\r\n### 3.9.3\r\n\r\n* Fix TypeScript exported types\r\n\r\n### 3.9.0\r\n\r\n* Cell types and formats!!! Now you can define the cell type and format. For example, you can define a cell as a date or a number. You can also define the format of the cell. For example, you can define a cell as a date with the format \"dd/mm/yyyy\" or a number with the format \"#,##0.00\".\r\n\r\n### 3.8.1\r\n\r\n* Activate XLSX compression by default. The example of index.bigtable.html went from 18Mb to 3Mb.\r\n* _Update npm dependencies to fix vulnerabilities_\r\n* Update to latest version of TypeScript\r\n* Reduced size of the library from 912 KB to 277 KB!!!\r\n\r\n### 3.8.0\r\n\r\n* Allow RTL options on the whole file or sheet.\r\n* _Update npm dependencies to fix vulnerabilities_\r\n\r\n### 3.7.3\r\n\r\n* Fix (#591) remove columns parameter. Now it is not affected by repeated column numbers nor its order.\r\n\r\n### 3.7.2\r\n\r\n* _Update npm dependencies to fix vulnerabilities_\r\n\r\n### 3.7.1\r\n\r\n* _Update npm dependencies to fix vulnerabilities_\r\n* Start using Dependabot and get rid of Dependabot-preview\r\n\r\n### 3.7.0\r\n\r\n* Added option `openAsDownload: boolean`. Use this option to download as a file without using an anchor tag. So download can be triggered from a button.\r\n* _Update npm dependencies to fix vulnerabilities_\r\n\r\n### 3.6.0\r\n\r\n* Added sponsor link to the project [:heart: Sponsor ExcellentExport.js project:heart:](https://github.com/sponsors/jmaister)\r\n* Transform the project from JavaScript to TypeScript\r\n* Configure Jest as test runner\r\n* _Update npm dependencies to fix vulnerabilities_\r\n\r\n### 3.5.0\r\n\r\n* Add fixValue and fixArray functions to configuration: these configuration functions can be used to manipulate the values of the cells.\r\n* _Update npm dependencies to fix vulnerabilities_\r\n\r\n### 3.4.3\r\n\r\n* _Update npm dependencies to fix vulnerabilities_\r\n\r\n### 3.4.2\r\n\r\n* Remove ES6 function syntax to support IE11\r\n* _Update npm dependencies to fix vulnerabilities_\r\n\r\n### 3.4.0\r\n\r\n* Configure TravisCI on GitHub\r\n* Update npm dependencies to fix vulnerabilities\r\n\r\n### 3.3.0\r\n\r\n* Remove columns by index\r\n* Filter rows by value\r\n* _Updated build to Webpack 4.x.x_\r\n\r\n### 3.2.1\r\n\r\n* _Update npm dependencies to fix vulnerabilities_\r\n\r\n### 3.2.0\r\n\r\n* _Update npm dependencies to fix vulnerabilities_\r\n\r\n### 3.1.0\r\n\r\n* Fix old API for base64 and escaping problem.\r\n\r\n### 3.0.0\r\n\r\n* XLSX support. This bumps the build size to 640 KB.\r\n* New API : ExcellentExport.convert(...)\r\n* Autogenerate download filename.\r\n* Data input from arrays or HTML Tables.\r\n* Multiple sheets for XLS or XLSX formats.\r\n\r\n### 2.1.0\r\n\r\n* Add Webpack build.\r\n* Create UMD JavaScript module. Library can be loaded as a module (import, RequireJS, AMD, etc...) or standalone as window.ExcellentExport.\r\n\r\n### 2.0.3\r\n\r\n* Fix export as a module.\r\n* Changed minifier to UglifyJS.\r\n\r\n### 2.0.2\r\n\r\n* Fix CSV Chinese characters and other special characters display error in Windows Excel.\r\n* Fix URL.createObjectURL(...) on Firefox.\r\n\r\n\r\n### 2.0.0\r\n\r\n* Now it can export to big files +2MB.\r\n* Minimum IE 11.\r\n* Links open with URL.createObjectURL(...).\r\n* NPM package available.\r\n* Using Semantic versioning (2.0.0 instead of 2.0).\r\n* Module can be loaded standalone or with RequireJS.\r\n* Change license to MIT.\r\n\r\n### 1.5\r\n\r\n* Possibility to select a CSV delimiter.\r\n* Bower package available.\r\n* Compose package available.\r\n\r\n### 1.4\r\n\r\n* _Add LICENSE.txt with GPL v3_\r\n* UTF-8 characters fixed.\r\n\r\n### 1.3\r\n\r\n* _Added minified version_\r\n\r\n### 1.1\r\n\r\n* _Added CSV data export_\r\n\r\n### 1.0\r\n\r\n* _Added Excel data export_\r\n\r\n## Compatibility\r\n\r\n - Firefox\r\n - Chrome\r\n - Internet Explorer 11+\r\n\r\n# Install\r\n\r\n## npm\r\n\r\n    npm install excellentexport --save\r\n\r\n## yarn\r\n\r\n    yarn add excellentexport\r\n\r\n## bower\r\n\r\n    bower install excellentexport\r\n\r\n# Load\r\n\r\n\r\n**Include script in your HTML:**\r\n\r\n    \u003cscript type=\"text/javascript\" src=\"dist/excellentexport.js\"\u003e\u003c/script\u003e\r\n\r\n**Include script in your HTML using CDN:**\r\n\r\n    \u003cscript type=\"text/javascript\" src=\"https://cdn.jsdelivr.net/npm/excellentexport@3.4.3/dist/excellentexport.min.js\"\u003e\u003c/script\u003e\r\n\r\n\r\n**Require.js**\r\n\r\n    \u003cscript src=\"http://requirejs.org/docs/release/2.3.6/minified/require.js\"\u003e\u003c/script\u003e\r\n    \u003cscript\u003e\r\n        require(['dist/excellentexport'], function(ee) {\r\n            window.ExcellentExport = ee;\r\n        });\r\n    \u003c/script\u003e\r\n\r\n**ES6 import**\r\n\r\n    import ExcellentExport from 'excellentexport';\r\n\r\n\r\n# Usage\r\n\r\n    \u003ctable id=\"datatable\"\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003e100\u003c/td\u003e \u003ctd\u003e200\u003c/td\u003e \u003ctd\u003e300\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003e400\u003c/td\u003e \u003ctd\u003e500\u003c/td\u003e \u003ctd\u003e600\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/table\u003e\r\n\r\n    \u003ca download=\"somedata.xls\" href=\"#\" onclick=\"return ExcellentExport.excel(this, 'datatable', 'Sheet Name Here');\"\u003eExport to Excel\u003c/a\u003e\r\n    \u003ca download=\"somedata.csv\" href=\"#\" onclick=\"return ExcellentExport.csv(this, 'datatable');\"\u003eExport to CSV\u003c/a\u003e\r\n    \u003c!-- new API, xlsx --\u003e\r\n    \u003ca download=\"somedata.xlsx\" href=\"#\" onclick=\"return ExcellentExport.convert({ anchor: this, filename: 'data_123.array', format: 'xlsx'},[{name: 'Sheet Name Here 1', from: {table: 'datatable'}}]);\"\u003eExport to CSV\u003c/a\u003e\r\n\r\n# API\r\n\r\n     ExcellentExport.convert(options, sheets);\r\n\r\n     Options:\r\n     {\r\n        anchor: String or HTML Element,\r\n        format: 'xlsx' or 'xls' or 'csv',\r\n        filename: String,\r\n        rtl: Use Right-to-left characters, boolean (optional)\r\n     }\r\n\r\n     Sheets must be an array of sheet configuration objects. Sheet description:\r\n     [\r\n        {\r\n            name: 'Sheet 1', // Sheet name\r\n            from: {\r\n                table: String/Element, // Table ID or table element\r\n                array: [...] // Array with the data. Array where each element is a row. Every row is an array of the cells.\r\n            },\r\n            removeColumns: [...], // Array of column indexes (from 0)\r\n            filterRowFn: function(row) {return true}, // Function to decide which rows are returned\r\n            fixValue: function(value, row, column) {return fixedValue} // Function to fix values, receiving value, row num, column num\r\n            fixArray: function(array) {return array} // Function to manipulate the whole data array\r\n            rtl: Use Right-to-left characters, boolean (optional)\r\n            formats: [...] // Array of formats for each column. See formats below.\r\n            ...\r\n        },\r\n        {\r\n            ...\r\n        }, ...\r\n    ]\r\n\r\n## fixValue example\r\n\r\nThis is an example for the _fixValue function_ to handle HTML tags inside a table cell.\r\nIt transforms BR to line breaks and then strips all the HTML tags.\r\n\r\n                fixValue: (value, row, col) =\u003e {\r\n                    let v = value.replace(/\u003cbr\u003e/gi, \"\\n\");\r\n                    let strippedString = v.replace(/(\u003c([^\u003e]+)\u003e)/gi, \"\");\r\n                    return strippedString;\r\n                }\r\n\r\n## Formats\r\n\r\nYou can specify an array with the formats for a specific cell range (i.e. A1:A100, A1:D100, A1:H1, etc).\r\n\r\nEach element in the format array consists on:\r\n\r\n```typescript\r\nconst sheet01 = {\r\n    \"range\": \"A1:A100\", // Range of cells to apply the format, mandatory\r\n    \"format\": {\r\n        \"type\": \"\u003ccell_type\u003e\", // Type of format, mandatory\r\n        \"pattern\": \"\u003cpattern\u003e\" // Pattern, optional\r\n    }\r\n}\r\n```\r\n\r\nExample:\r\n\r\n```typescript\r\n          formats: [\r\n            {\r\n              range: \"C2:C20\",\r\n              format: {\r\n                type: \"n\",\r\n                pattern: \"0.00\",\r\n              },\r\n            },\r\n            {\r\n              range: \"C2:C20\",\r\n              format: ExcellentExport.formats.NUMBER,\r\n            }\r\n          ]\r\n```\r\n\r\n`format` can be used from one of the predefined types if you use TypeScript\r\n\r\n\r\n`cell_type` can be one of the followint:\r\n\r\n    's': String\r\n    'n': Number\r\n    'd': Date\r\n    'b': Boolean\r\n\r\n`pattern` is a string with the format pattern used in Excel. For example:\r\n\r\n    '0' // Integer\r\n    '0.00' // 2 decimals\r\n    'dd/mm/yyyy' // Date\r\n    'dd/mm/yyyy hh:mm:ss' // Date and time\r\n    '0.00%' // Percentage\r\n    '0.00e+00' // Scientific notation\r\n    '@' // Text\r\n\r\n# Notes\r\n\r\n - IE8 or lower do not support *data:* url schema.\r\n - IE9 does not support *data:* url schema on links.\r\n - IE10 and above and Edge are supported via the Microsoft-specific `msOpenOrSaveBlob` method.\r\n\r\n# Test\r\n\r\n    python 2.x:\r\n        python -m SimpleHTTPServer 8000\r\n\r\n    python 3.x:\r\n        python -m http.server 8000\r\n\r\n# Build\r\n\r\n**Install dependencies:**\r\n\r\n    npm install\r\n\r\n**Build development version dist/excellentexport.js**\r\n\r\n    npm run build\r\n\r\n**Build publish version of dist/excellentexport.js**\r\n\r\n    npm run prod\r\n\r\n**Publish**\r\n\r\n    npm publish\r\n\r\n## Dependencies\r\n\r\n- XLSX is not available from NPM anymore. Use https://cdn.sheetjs.com/ to install it.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmaister%2Fexcellentexport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmaister%2Fexcellentexport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmaister%2Fexcellentexport/lists"}