{"id":18016643,"url":"https://github.com/estie-inc/wasm-xlsxwriter","last_synced_at":"2026-02-01T08:01:34.971Z","repository":{"id":259531884,"uuid":"857988157","full_name":"estie-inc/wasm-xlsxwriter","owner":"estie-inc","description":"Generate Excel files in-browser with WebAssembly.","archived":false,"fork":false,"pushed_at":"2026-01-30T04:58:59.000Z","size":765,"stargazers_count":127,"open_issues_count":9,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-30T21:00:02.175Z","etag":null,"topics":["excel","frontend","javascript","typescript","wasm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/estie-inc.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-16T05:10:02.000Z","updated_at":"2026-01-30T04:57:39.000Z","dependencies_parsed_at":"2024-12-13T01:20:31.338Z","dependency_job_id":"29d73c04-8e33-46c5-8a30-a5420441ef6e","html_url":"https://github.com/estie-inc/wasm-xlsxwriter","commit_stats":null,"previous_names":["estie-inc/wasm-xlsxwriter"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/estie-inc/wasm-xlsxwriter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estie-inc%2Fwasm-xlsxwriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estie-inc%2Fwasm-xlsxwriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estie-inc%2Fwasm-xlsxwriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estie-inc%2Fwasm-xlsxwriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/estie-inc","download_url":"https://codeload.github.com/estie-inc/wasm-xlsxwriter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estie-inc%2Fwasm-xlsxwriter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28973040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T06:46:42.625Z","status":"ssl_error","status_checked_at":"2026-02-01T06:44:56.173Z","response_time":56,"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":["excel","frontend","javascript","typescript","wasm"],"created_at":"2024-10-30T04:18:44.512Z","updated_at":"2026-02-01T08:01:34.955Z","avatar_url":"https://github.com/estie-inc.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# wasm-xlsxwriter [![NPM Version](https://img.shields.io/npm/v/wasm-xlsxwriter)](https://www.npmjs.com/package/wasm-xlsxwriter)\n\nThe `wasm-xlsxwriter` library is a lightweight wrapper around the write API of Rust's [`rust_xlsxwriter`](https://crates.io/crates/rust_xlsxwriter), compiled to WebAssembly (Wasm) with minimal setup to make it easily usable from JavaScript or Node.js.\n\nWith this library, you can generate Excel files in the browser or Node.js using JavaScript, complete with support for custom formatting, formulas, links, images, and more.\n\n## Getting Started\n\nTo get started, install the library via npm:\n\n```bash\nnpm install wasm-xlsxwriter\n```\n\n### Usage Web\n\nHere’s an example of how to use `wasm-xlsxwriter` to create an Excel file:\n\n```typescript\nimport xlsxInit, {\n  Format,\n  FormatAlign,\n  FormatBorder,\n  Formula,\n  Workbook,\n  Image,\n  Url,\n} from \"wasm-xlsxwriter/web\";\n\n// Load the WebAssembly module and initialize the library.\nawait xlsxInit();\n\n// Create a new Excel file object.\nconst workbook = new Workbook();\n\n// Create some formats to use in the worksheet.\nconst boldFormat = new Format().setBold();\nconst decimalFormat = new Format().setNumFormat(\"0.000\");\nconst dateFormat = new Format().setNumFormat(\"yyyy-mm-dd\");\nconst mergeFormat = new Format()\n  .setBorder(FormatBorder.Thin)\n  .setAlign(FormatAlign.Center);\n\n// Add a worksheet to the workbook.\nconst worksheet = workbook.addWorksheet();\n\n// Set the column width for clarity.\nworksheet.setColumnWidth(0, 22);\n\n// Write a string without formatting.\nworksheet.write(0, 0, \"Hello\");\n\n// Write a string with the bold format defined above.\nworksheet.writeWithFormat(1, 0, \"World\", boldFormat);\n\n// Write some numbers.\nworksheet.write(2, 0, 1);\nworksheet.write(3, 0, 2.34);\n\n// Write a number with formatting.\nworksheet.writeWithFormat(4, 0, 3.0, decimalFormat);\n\n// Write a formula.\nworksheet.writeFormula(5, 0, new Formula(\"=SIN(PI()/4)\"));\n\n// Write a date.\nconst date = new Date(2023, 1, 25);\nworksheet.writeWithFormat(6, 0, date, dateFormat);\n\n// Write some links.\nworksheet.writeUrl(7, 0, new Url(\"https://www.rust-lang.org\"));\nworksheet.writeUrl(8, 0, new Url(\"https://www.rust-lang.org\").setText(\"Rust\"));\n\n// Write some merged cells.\nworksheet.mergeRange(9, 0, 9, 1, \"Merged cells\", mergeFormat);\n\n// Insert an image (ensure `imageBuffer` contains the image data).\nconst image = new Image(imageBuffer);\nworksheet.insertImage(1, 2, image);\n\n// Save the file to a buffer.\nconst buf = workbook.saveToBufferSync();\n```\n\n### Usage Node.js\n\n```ts\nimport {\n  Color,\n  DocProperties,\n  Format,\n  FormatAlign,\n  Workbook,\n} from \"wasm-xlsxwriter\";\n\n/**\n * Demo function that create a xlsx buffer from a header array and data rows\n *\n * @param {string[]} header - Sheet header strings\n * @param {(string | number)[][]} rows - Array of arrays containing sheet rows\n * @returns {Buffer} Excel file data\n */\nfunction writeExcel(header: string[], rows: (string | number)[][]): Buffer {\n  // Create a new Excel file object.\n  const workbook = new Workbook();\n\n  // Set a doc property\n  const props = new DocProperties().setCompany(\"Test, Inc.\");\n  workbook.setProperties(props);\n\n  // Add a worksheet with name to the workbook.\n  const worksheet = workbook.addWorksheet();\n  worksheet.setName(\"Export\");\n\n  // Create some formats to use in the worksheet.\n  const headerStyle = new Format();\n  headerStyle\n    .setAlign(FormatAlign.Top)\n    .setTextWrap()\n    .setBackgroundColor(Color.red());\n\n  // Write sheet header\n  worksheet.writeRowWithFormat(0, 0, header, headerStyle);\n\n  // Write sheet data\n  worksheet.writeRowMatrix(1, 0, rows);\n\n  // Autofit columns\n  worksheet.autofit();\n\n  // Freeze header\n  worksheet.setFreezePanes(1, 0);\n\n  // Add autofilter to header\n  worksheet.autofilter(0, 0, rows.length, header.length - 1);\n\n  // Return buffer with xlsx data\n  const uint8Array = workbook.saveToBufferSync();\n  return Buffer.from(uint8Array);\n}\n```\n\n## Browser Support\n\nThis library is compiled with `-C target-cpu=mvp` to target WebAssembly MVP, with only the following features explicitly enabled via [rustflags in .cargo/config.toml](rust/.cargo/config.toml):\n* `mutable-globals`\n* `sign-ext`\n* `bulk-memory`\n* `nontrapping-fptoint`\n\nThis build configuration uses nightly Rust with `-Z build-std` to avoid `reference-types` and `multivalue`, which are enabled by default in recent stable Rust versions but have limited browser support.\n\nSee [Enabled WebAssembly features](https://doc.rust-lang.org/rustc/platform-support/wasm32-unknown-unknown.html#enabled-webassembly-features) for additional information.\n\nAs a result, the library should be compatible with:\n* Chrome (Edge) 75+\n* Firefox 79+\n* Safari 15+\n\nFor more details on WebAssembly features, visit:\n[WebAssembly Features Overview](https://webassembly.org/features/)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Festie-inc%2Fwasm-xlsxwriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Festie-inc%2Fwasm-xlsxwriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Festie-inc%2Fwasm-xlsxwriter/lists"}