{"id":19153562,"url":"https://github.com/claviz/xlstream","last_synced_at":"2025-04-04T19:10:34.989Z","repository":{"id":34115489,"uuid":"169991720","full_name":"Claviz/xlstream","owner":"Claviz","description":"Turns XLSX into a readable stream.","archived":false,"fork":false,"pushed_at":"2024-08-05T09:09:09.000Z","size":726,"stargazers_count":171,"open_issues_count":2,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T18:12:47.471Z","etag":null,"topics":["excel","node","stream-processing","xlsx"],"latest_commit_sha":null,"homepage":null,"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/Claviz.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":"2019-02-10T15:18:26.000Z","updated_at":"2024-12-22T21:26:28.000Z","dependencies_parsed_at":"2024-11-09T08:35:12.227Z","dependency_job_id":null,"html_url":"https://github.com/Claviz/xlstream","commit_stats":{"total_commits":85,"total_committers":10,"mean_commits":8.5,"dds":"0.44705882352941173","last_synced_commit":"af0c0c027c9d7195f92bba84d038e82277fa4fbf"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Claviz%2Fxlstream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Claviz%2Fxlstream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Claviz%2Fxlstream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Claviz%2Fxlstream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Claviz","download_url":"https://codeload.github.com/Claviz/xlstream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234921,"owners_count":20905854,"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","node","stream-processing","xlsx"],"created_at":"2024-11-09T08:23:29.916Z","updated_at":"2025-04-04T19:10:34.969Z","avatar_url":"https://github.com/Claviz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/Claviz/xlstream.svg?branch=master)](https://travis-ci.org/Claviz/xlstream)\n[![codecov](https://codecov.io/gh/Claviz/xlstream/branch/master/graph/badge.svg)](https://codecov.io/gh/Claviz/xlstream)\n![npm](https://img.shields.io/npm/v/xlstream.svg)\n\n# xlstream\n\nMemory-efficiently turns XLSX file into a [transform stream](https://nodejs.org/api/stream.html#stream_duplex_and_transform_streams) with all its benefits.\n\n- Stream is **pausable**.\n- Emits all **default events** (`data`, `end`, etc.)\n- Returns **header**, **raw** and **formatted** row data, as well as **totalSheetSize** and **processedSheetSize** (in bytes) in just one `data` event.\n- Maintains desirable behavior of **merged cells**.\n- Supports files created by **OpenXML**.\n- Supports **standard**, **Excel** and **custom number formats**.\n\n## Installation\n\n```\nnpm install xlstream\n```\n\n## Example\n\n`source.xlsx` contents:\n\n| A     | B   |\n| ----- | --- |\n| hello | 123 |\n\nWhere `123` is a `123.123` number formatted to be rounded to integer.\n\n**Script:**\n\n```javascript\nconst { getXlsxStream } = require(\"xlstream\");\n\n(async () =\u003e {\n  const stream = await getXlsxStream({\n    filePath: \"./source.xlsx\",\n    sheet: 0,\n  });\n  stream.on(\"data\", (x) =\u003e console.log(x));\n})();\n```\n\n**Result:**\n\n```JSON\n{\n    \"raw\": {\n        \"obj\": { \"A\": \"hello\", \"B\": 123.123 },\n        \"arr\": [ \"hello\", 123.123 ]\n    },\n    \"formatted\": {\n        \"obj\": { \"A\": \"hello\", \"B\": 123 },\n        \"arr\": [ \"hello\", 123 ]\n    },\n    \"header\": [],\n    \"totalSheetSize\": 1110,\n    \"processedSheetSize\": 1110\n}\n```\n\n## getXlsxStream\n\nReturns _transform stream_ of the sheet.\n\n### Options\n\n| option          | type                              | description                                                                                                                                                                                                                                                                                                                                                                       |\n| --------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| filePath        | `string`                          | Path to the XLSX file                                                                                                                                                                                                                                                                                                                                                             |\n| sheet           | `string` or `number`              | If `string` is passed, finds sheet by it's name. If `number`, finds sheet by it's index.                                                                                                                                                                                                                                                                                          |\n| withHeader      | `boolean` or `number`             | If `true`, column names will be taken from the first sheet row. If duplicated header name is found, column name will be prepended with column letter to maintain uniqueness. 0-based row location can be passed to this option if header is not located on the first row.                                                                                                         |\n| ignoreEmpty     | `boolean`                         | If `true`, empty rows won't be emitted.                                                                                                                                                                                                                                                                                                                                           |\n| fillMergedCells | `boolean`                         | If `true`, merged cells will have the same value (by default, only the first cell of merged cells is filled with value). **Warning!** Enabling this feature may increase streaming time because file must be processed to detect merged cells before actual stream.                                                                                                               |\n| numberFormat    | `standard` or `excel` or `object` | By default `standard` format is used. Excel implementation of number formatting differs from standard (can be read [here](https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oi29500/17d11129-219b-4e2c-88db-45844d21e528)) so `excel` option can be used to match this difference. If custom formatting is needed, a dictionary object can be passed to this option. |\n| encoding        | `string`                          | Sets file encoding.                                                                                                                                                                                                                                                                                                                                                               |\n\n## getXlsxStreams\n\nAsync [generator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*) which yields transform streams of the sheets.\n\n### Options\n\n| Option   | Type                   | Description                                 |\n| -------- | ---------------------- | ------------------------------------------- |\n| filePath | `string`               | Path to the _XLSX file_                     |\n| sheets   | array of sheet objects | Options of sheet object can be found below. |\n| encoding | `string`               | Sets file encoding.                         |\n\n#### Sheet object\n\n| option          | type                              | description                                                                                                                                                                                                                                                                                                                                                                       |\n| --------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| id              | `string` or `number`              | If `string` is passed, finds sheet by it's name. If `number`, finds sheet by it's index.                                                                                                                                                                                                                                                                                          |\n| withHeader      | `boolean`                         | If `true`, column names will be taken from the first sheet row. If duplicated header name is found, column name will be prepended with column letter to maintain uniqueness. 0-based row location can be passed to this option if header is not located on the first row.                                                                                                         |\n| ignoreEmpty     | `boolean`                         | If `true`, empty rows won't be emitted.                                                                                                                                                                                                                                                                                                                                           |\n| fillMergedCells | `boolean`                         | If `true`, merged cells will have the same value (by default, only the first cell of merged cells is filled with value). **Warning!** Enabling this feature may increase streaming time because file must be processed to detect merged cells before actual stream.                                                                                                               |\n| numberFormat    | `standard` or `excel` or `object` | By default `standard` format is used. Excel implementation of number formatting differs from standard (can be read [here](https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oi29500/17d11129-219b-4e2c-88db-45844d21e528)) so `excel` option can be used to match this difference. If custom formatting is needed, a dictionary object can be passed to this option. |\n\n## getWorksheets\n\nReturns array of sheets with `name` and `hidden` info.\n\n### Options\n\n| Option   | Type     | Description             |\n| -------- | -------- | ----------------------- |\n| filePath | `string` | Path to the _XLSX file_ |\n\n## Building\n\nYou can build `js` source by using `npm run build` command.\n\n## Testing\n\nTests can be run by using `npm test` command.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaviz%2Fxlstream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclaviz%2Fxlstream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaviz%2Fxlstream/lists"}